MV Battle A.I. Core (YEP): Targeting based on states

I am trying to create an enemy that doesn't deal any damage but inflicts the 'Undead' state on a party member and causes a 'Game Over' if all the party members have the status. The problem is that, although I can set it so that the enemy uses the skill as long as at least one party member isn't 'Undead', I can't make it so that it only targets party members who don't have the 'Undead' state. I refuse to use Yanfly's 'Target Core' or 'Selection Control', as they seriously mess up the program.
Any idea how to make it so that the enemy A.I. only targets party members who have or don't have a specific state?
I believe the video introducing Battle AI Core had a slide on this exact question.
One option without any plugins would be to have the undead state include the trait "target rate 0%" as that would remove the state bearer from all random targeting for all enemy skills.

IF you can live with that side effect (that other enemies with different skills no longer target the undead either) then this is the simplest solution.
As you are asking specifically about Yanfly's AI core anyway, have a looked at the help file where it says:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
STATE === state x
STATE === state name
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This will detect if the target scope has state x (or state name if you use
that instead). If the target does, that target is added into the pool of
valid targets. Any targets not affected by the state will be ignored.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example: State === State 5: DeBlind, Highest ATK
State === Knockout: Life, Random
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
STATE !== state x
STATE !== state name
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This will detect if the target scope does not have state x (or state name if
you use that instead). If the target doesn't, that target is added into the
pool of valid targets. Any targets affected by the state will be ignored.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example: State !== State 12: Haste, Random
State !== Courage: Cowardice, Highest ATK
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This seems to directly answer your question.
As you are asking specifically about Yanfly's AI core anyway, have a looked at the help file where it says:

This seems to directly answer your question.
Not really. The help file explains how to set the conditions for using a skill, but not the targeting aspects of it. The examples provided only target either a random party member (whether they have the state or not) or the party member with the highest ATK (whether they have the state or not). I don't even think the DeBlind skill would specifically target party members who were blind.
Please read the help file (or my quote from it above) again. The plugin looks at every member of the skill scope individually and adds them as a valid target depending on whether they have the state or not. The selection after that (random or highest ATK in the above examples) only applies to this pool of valid targets, not the whole scope.
My mistake. I was testing for the wrong state. Silly me!

Original thread: https://forums.rpgmakerweb.com/threads/battle-a-i-core-yep-targeting-based-on-states.143508/