Hmm, here is the issue:
First script you gave, I add ZVSE2 in header, right?
I load game, press F12, bunch of errors (unknown constant global
Second script
If I load save game before the battle I did before testing, then F12, no clone
If I load previous Battle save (igrik plugin) then F12, clone come first round ( so ok).
If I attack a creature bank with Kyrie (has tactics) after F12, battle ok
If I attack same creature bank with another hero (no tactics) after F12, crash every time
It worked only when I loaded Battle.gm1,