There are multiple ways to handle this:
1) Use a Block Status Value status change type in the effect that e.g. blocks negative changes to your health.
Ending after attack is a bit tricky, since you can't do this based on damage to health due to that being blocked. You have to use the Action End end after type with Is Action Target enabled, Only By User and By Allies disabled, By Enemies enabled.
With this setup, the first action an enemy does on the combatant with the effect will remove it at the end, blocking damage to health.
2) Use a barrier status value that takes damage instead of health.
The effect fills the barrier stat and ends on changes to the barrier stat.
3) Handle the 0 damage as part of the damage calculation formula (checking for the effect and setting formula value to 0).
Ending the effect would work like in #1, not sure if checking for health stat change of 0 works for ending the effect.