Once per battle one-time immunity to knockout

Hey everybody, if you wanted to make a state with the following conditions, how would you go about doing it? This is for a player character, not an enemy. Thanks!

This effect activates a maximum of once per battle.
It activates when a character is hit with an attack that would drop his/her HP to 0.
When the effect activates, the character is left with 1 HP regardless of how much damage he/she took, and the character is not knocked out.

After the effect activates once, it is no longer usable during the current battle. If the character is hit then the effect activates, and following that they're immediately hit again by another enemy, they're toast.
Grant Immortal at the start of an encounter. Each turn, check if their HP is at 0, and if so, restore 1 HP and remove Immortal.
Thanks for the suggestion! That would require adding those conditions to every troop, is that right? If so is there any way to achieve this effect without that amount of legwork?
Thanks for the suggestion! That would require adding those conditions to every troop, is that right? If so is there any way to achieve this effect without that amount of legwork?
http://yanfly.moe/2015/10/18/yep-15-base-troop-events/

Original thread: https://forums.rpgmakerweb.com/threads/once-per-battle-one-time-immunity-to-knockout.107179/