So you only changed these 2 lines? And copied everything else exactly?
(1, 0, 5, [(lt,"$defender_reinforcement_stage",2),
(1, 0, 5, [(lt,"$attacker_reinforcement_stage",2),
If that's the case not sure what to tell you. I copied with no changes and works fine, so maybe try testing an unmodified copy?