How can I make that an enemy always hits a certain character with an specific skill?

I'm struggling with the problem for a longer time and I always have to find a cheap workaround. The Yanfly AIBattleCore allows to specify target but it looks like that, there is no possibility to define a specific character, like giving the ID for the character an then the enemy always attacks only the character with the id. Is there something like that?
I'm struggling with the problem for a longer time and I always have to find a cheap workaround. The Yanfly AIBattleCore allows to specify target but it looks like that, there is no possibility to define a specific character, like giving the ID for the character an then the enemy always attacks only the character with the id. Is there something like that?

You are going to need Yanfly Target Core and Yanfly Selection Control, in addition to your current Yanfly plugins. What you will need to do is setup the following code in the skill of the enemy:

JavaScript:
<Custom Select Condition>
    if (target.name() === 'Harold') {
        condition = true;
    } else {
        condition = false;
    }
</Custom Select Condition>

Where 'Harold' is the 'Actor' you want targeted. If you read through the descriptions of both Target Core and Selection Control you can find quite a bit of ways to modify how skills decide who they hit. You will need to make sure to set conditions as well that ensure that the enemy will use the skill, and wont just skip using the skill and not targeting the actor you want hit.

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-make-that-an-enemy-always-hits-a-certain-character-with-an-specific-skill.120437/