Substitute special flag (Resolved)

Hello,
I need help modifying the substitute special flag.
I don't know if the term "substitute" is the right translation because English is not badly the original language.
This is the effect that allows a character to protect an ally whose HP is low during an attack.

Currently, a character who obtains this special effect is able to protect the entire party during a multi-target attack.
If I have 4 characters (the one protecting, and 3 others whose HP is low), the protector is able to take 4 times the damage of a multi-target attack.
This is not suitable for my project and I would like to know if it is possible to modify this using a script for example.

What I want is for this effect to trigger only for single target attacks. Not for multi-target attacks.
I don't want to change anything else.

Is it possible to get this result?
I specify that I use TargetCore from Yanfly. I don't think it's a problem but I prefer to warn.
Thanks to those who will help me.
It is also known as White Knight, named after Cecil who was a lead character in FF4.
...Substitute is the correct word for the English versions of RPG Maker.

What you're asking for would require a plugin. Have you looked at any yet?

This one looks like it offers a lot of control:

If nothing else, it offers a notetag to specify skills that ignore substitute, so you could just put that on all of your multiple target skills.
Excellent idea. I'll try and edit my title if the topic is resolved.
Thanks very much


Edit :
I have a feeling this isn't going to work.
The plugin that you propose to me is good but modifies the way in which the substitution is done.
For example: character A casts a spell on characters B, C and D to apply a state to them. This state allows A to protect B, C and D in the event of an attack (because it is A who is at the origin of the spell).
Anyway, that's what I understood.

The problem being that for my project, my protective character (character A in my example) will not need to cast a spell. He will have the state of substitution permanently (or rather, with the help of equipment).

So I did some tests and it didn't work. The idea was good though. Maybe there is another solution?
If you combine taaspider's plugin with Yanfly Passive States, you might be able to get the result you're looking for, though I'm not sure if having a permanent substitute state is a great idea unless you balance it well. You don't want enemies to be no threat to your party because of your substitute guy, but neither do you want your substitute guy dying all the time because the enemy hits too damn hard.
I have a feeling this isn't going to work.
The plugin that you propose to me is good but modifies the way in which the substitution is done.
For example: character A casts a spell on characters B, C and D to apply a state to them. This state allows A to protect B, C and D in the event of an attack (because it is A who is at the origin of the spell).
Anyway, that's what I understood.
No, that's not correct. There's nothing in the plugin instructions that lets the state notetags designate another battler to substitute for them.

Well, technically, the eval condition portion would allow you to do that, but it's not how it works by default.

The substitution states work exactly like a state with the Substitution flag in the default engine, except it gives you more options over when it triggers.

my protective character (character A in my example) will not need to cast a spell. He will have the state of substitution permanently (or rather, with the help of equipment).
As @Sword_of_Dusk said, combine this with Yanfly's Auto Passive States. You can put it directly on the character or on a piece of equipment.

So I did some tests and it didn't work.
You can share screenshots of the notetags you entered - it sounds like you didn't set them up quite right.
Ok, I'll try to take a closer look this weekend. Maybe I misused the plugin. It is not as well explained as those of yanfly ^^"
Thanks for your answers, I'll keep you posted.
Ok, I'll try to take a closer look this weekend. Maybe I misused the plugin. It is not as well explained as those of yanfly ^^"
Thanks for your answers, I'll keep you posted.
Believe me, whenever anybody quickly reads some plugin and installs it without making sure they read the instructions, stuff happens. Even ugly ones sometimes. Don't feel bad about it, you're just going through a learning curve like learning how to use a new machine you just bought at a large store.
After a lot of time studying the plugin. I have just had confirmation from its creator that it does not correspond to what I am looking for. Here is his response:

<< My plugin gives more flexibility to substitution, but it assumes a skill will be used to activate it, so there's not an easy way to adapt it for use as a passive skill. [...] To change how the states are applied would required me to change almost everything in the plugin's inner workings. >>


Anyone know another solution please? Even if it means directly modifying the initial script of the software
After a lot of time studying the plugin. I have just had confirmation from its creator that it does not correspond to what I am looking for.
Did you try the configuration suggested earlier in this thread?

I ask this because the quote that you posted does not read like it's addressing what you asked.

<< My plugin gives more flexibility to substitution, but it assumes a skill will be used to activate it, so there's not an easy way to adapt it for use as a passive skill. [...] To change how the states are applied would required me to change almost everything in the plugin's inner workings. >>
You don't need this plugin to adapt anything for a passive skill or to change how states are applied. That's what the Yanfly Auto Passive States plugin would do. So it doesn't seem like this e-mail response is relevant to your discussion.

That all being said, the TAA plugin clearly does some very screwy and unintuitive things.

Just copy this into a text editor, save it as a *.js file, and include it as a plugin.

Code:
BattleManager.checkSubstitute = function(target) {
    return target.isDying() && !this._action.isCertainHit() && this._action.item().scope==1;
};
Thanks Truan, once again you have the right solution.
I was imagining a solution where I would have to remove the state before each multi-target attack using the action sequence plugin. It might have worked but your method is much simpler.
It works, thank you very much =)

Original thread: https://forums.rpgmakerweb.com/threads/substitute-special-flag-resolved.154401/