Yea, sorry, I was very sleepy. Was up all night programming. lol
I am using Python, but any examples in any language would help alot.
The AI has "spells" that have a priority. I check if the AI's health is low. If so, and it has a healing spell, it uses it. Else it uses a high priority "spell".
This is a turn based system.
There are no events that could interfere. This is just a battle system, written in Python, not a RPG Maker or Game Maker