You don't need a script, a battle-triggered parallel process is enough.
1) define a switch of your choice as "Battle in Progress".
2) in every troop, add a troop event set to be executed at turn 0 only and only containing the command "control switch ON for the battleswitch from 1)
3) in Database, make a new common event as a parallel process triggered by that switch
4) add only two commands to that parallel process: full recovery and after that "control switch OFF" for the switch.
Finish - it will work unless you changed the engine a lot with scripts. It doesn't even make a difference if you're using random or evented encounters, it'll work fo both.