How do I make Yanfly's elemental testing take elemental states into account?

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>
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>
You haven't included a target.
You haven't included a target.
Technically speaking, the instructions say including a target is optional.

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.
The problem is that you're looking at your conditions sequentially. The instruction "If they're immune to ice, cast Spark" comes first and does not have any consideration for whether they're also immune to lightning.

So check out the portion of the instructions that describes how to use +++ to combine conditions and try to figure out the logically easiest way to describe what you want to happen.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-yanflys-elemental-testing-take-elemental-states-into-account.153202/