in my game "Reality Hackers", I have a global called "$life", which can be edited at any time by typing "$life = 9" or "$life = 9999", for instance, in the event script editor.
A simple series of switches allows this variable to be turned on and off. Above Game_Temp, I set the variable to 0, by stating:
$life = 0
Now, in game actor, I have the following:
#--------------------------------------------------------------------------
# * Get Maximum HP
#--------------------------------------------------------------------------
def maxhp
#reality Hack #001: life hack
n = [[base_maxhp + @maxhp_plus, 1].max, 9999].min
for i in @states
n *= $data_states[i].maxhp_rate / 100.0
end
n = [[Integer(n) + $life, 1].max, 9999].min
return n
end
What you then do is set a variable that records the actor's max hp before the life hack, say 775, for instance.
Then you switch on the hp bonus, of say, +25, and that pushes them to 800. Then, and only then, do you "heal all" party members. Otherwise your max will be up but your current will still be lower.
Whenever the character is damaged, you can compare the variable to their current, if the variable is greater, then you switch off the hack and set $life = 0.
Naturally this only works well with one actor. If you want to do this to all four actors, you will need to make $life into @life as an attr_accessor of actors. Honestly doing this through script+eventing is the fastest way I know, because you could add a line in battle script to immediately check current hp to max hp and if the current was less, switch off the bonus for that actor, right there.