I've found 4 bugs relating to AI, but only 2 come up in game.
- One of the AI actions can revive other enemies to full, 1/2, or 1/4 HP, but no matter the setting, it always revives to full HP. This is only used by the final Lavos, where it revives the bits at full HP intentionally.
- HP to 1 attacks disable Barrier and Shield for the remainder of the battle.
- Enemies targeting the PC with the lowest HP will ignore PC 1
- One of the AI conditions is completely buggy. From what's in the code, it looks like it was intended to be "if attacked by men or women" condition, but I can't be 100% certain.
The code you're testing fixes the first two, and I have a fix for the third. I haven't decided what I'm going to do about that last one yet.
Edit: I took another look at that AI condition.
It has two modes, one of which is buggy. The working mode is "if attacked by specified PC". The buggy mode compares a value of 0 or 1 to 1, 2, or 5.
If I assume that there's a missing instruction in the code, and that instruction is the same as the other mode, the code becomes "if attacker is (or isn't) PC 1, 2, or 5", or Marle, Lucca, and Ayla. So it's almost a check on women, with a couple lines missing.
I'm thinking I should restore those lines and make it that.