Upgrade RSB II to new AI system

Also reinstated the 3-turn clause for Immune status, added a new battle
event: itemUsed, and a few minor tweaks under the hood.