You may want to add call to unit.setHealth unitStat;. BattleUnit.Stats.* sets maximum stat value, current health value needs to be set separately to avoid stat penalties for missing health. Also setTimeUnits, setEnergy and setMana.
#health:
unit.Stats.getHealth unitStat;
if gt unitStat 0;
set minValue unitStat;
set maxValue unitStat;
muldiv minValue minPercent 100;
muldiv maxValue maxPercent 100;
battle_game.randomRange unitStat minValue maxValue;
unit.Stats.setHealth unitStat;
unit.setHealth unitStat; ### <--- here
#debug_log "Unit" unitID "Health (" minValue "-" maxValue "):" unitStat;
end;