Script for enemy to avoid targeting a state afflicted actor, using YEP Target Core.

First, let me say that my scripting skills are close to zero.

I have two enemies (in the same troop) that use a "targeting" ability to set a state which increases the Target Rate of the inflicted actor, in order to perform their next attack on him. My problem is, that once the first state has been applied, the next "targeting" ability will also be performed on the already afflicted actor. Is there any way, by using Yanfly's Target Core Lunatic Mode, to check if an actor is already afflicted by the aforementioned state and thus, avoid to target him with the specific skill once again?

Thanks in advance!

Original thread: https://forums.rpgmakerweb.com/threads/script-for-enemy-to-avoid-targeting-a-state-afflicted-actor-using-yep-target-core.89786/