As the title states, I am trying to make the AI continue with elemental testing while taking states into account that change the target's elemental rates. For example, I am trying to make one of my bosses use the skill "chill", an ice spell, if the target is immune to lightning, and the spell "spark" if the target is immune to ice. However, all he does is continuously use spark despite the fact the target has a state that makes them immune to lightning. Here is what I am trying to do:
<AI Priority>
Random 50%: Attack
Element Ice Null: Spark
Element Lightning Null: Chill
</AI Priority>
<AI Priority>
Random 50%: Attack
Element Ice Null: Spark
Element Lightning Null: Chill
</AI Priority>