No. As mentioned, it's not required. It'd help manage the state for the all party member versions, but it's not needed to get the effect going.
Yanfly's auras don't last indefinitely. They last for however long the state they're attached to is active on the target. It means they can last indefinitely if the state doesn't have an end duration or is a passive, but if the base state has a duration, the auras have the same duration (and will also end on all allies automatically if the base state is removed early, or be extended on all allies if the duration of the base state is extended)
So with auras, you would have your tank target themself with a skill that gives them the "guardian" state. It'll last lets say 3 turns, and that state would have an aura effect to project the "guarded" state on all allies with that react effect. The code would need to change a little bit though.
Its entirely up to you. What I gave you already is how it should be if you're not using auras, but the state is applied to all other party members individually, the state isn't actually tied to the user, they all technically last for their own durations, and you have to add manual checks to remove the states or else it'll linger and you get situations like "the tank takes damage for an ally, dies, gets back up, and then dies again because the ally never lost the cover state"
yep. that's the only needed modification.
correct on all of these
The protected ally takes 50% of the damage and the tank takes the other 50% that the ally didn't take.
It was a functional example, but exactly so. If it's 1.5, the guard takes 150% of the damage the ally would have taken. Since its greater than 100% it still means that the target is fully protected from the damage, but the tank takes 50% more additional damage than what the ally would have taken.
Yes. And it should work as is for both the the single target, and the full party protection.
Oh, first of all, I created a skill using the code you provided, and it definitely takes the damage on behalf of the character!
Just in case, I created another state with the same effect and applied it to both simultaneously for testing purposes.
I need to verify whether this is intended or not, and since it might be helpful to someone, I will write down what I tested.
Guard B first applied the 'Take Instead' state to Character A. Then, later, Character C applied a different 'Take Instead' state to A using a different skill, with exactly the same effect.
Now, when an enemy attacks A, the damage for both A and B appears as 0, and C takes the damage instead.
Does the state's ID number take priority?
Additionally, if there is a problem, it is with defense and damage reduction.
1. Character A took 3,000 damage by default.
2. B applied the 'Take Instead' state. Now let's take the attack again.
3. An enemy attacks A, and B takes 3,000 damage. Excellent.
4. However, there is another issue. B uses 'Defense' (the 'Defense' command, which is the most basic skill number 2 in the skill tab).
5. The enemy attacks A, but B still takes 3,000 damage.
6. Conversely, A uses 'Defense'.
7. When the enemy attacks A, this time B takes 1,500 damage.
I understand that the reason for this judgment is likely because the 'damage received' by character A is transferred directly to B, but is it possible to reduce the damage received based on character B? (However, this is not strictly necessary; perhaps for the sake of balance, the current state might actually be better.)
It is very useful as it is, and I think it is good!
Then, the problem arises when there are various 'take damage' skills in the game.
Since it is difficult to determine which state takes precedence, I believe it would be better to make it impossible to target or ineffective against allies afflicted with the "Take Instead" state, rather than trying to make it easier for players to understand which "Take Instead" takes priority.
I am using YEP's State Categories plugin and Target Core; would it be possible to utilize these to prevent targets with the "Take Instead" state from being targeted, and additionally, to prevent the state from being applied specifically to targets with skills that guard the entire party?
EDIT+) Additionally, the same applies when enemy attacks inflict status effects such as "Stun." Currently, Character A takes the status effect, but Character B takes the damage; I would like to resolve this as well.
That is the default effect of guard, yes. Specifically, it applies a state that reduces damage by about half (modified by the Guard Effect special parameter). But there's nothing to stop you from making a skill that applies that state to the whole party, instead of just the user. Then one actor would sacrifice their turn to reduce damage for the entire party.
It's clear now that that's not what you were looking for, however. It sounds like what you need is a plugin that modifies how Substitute works, or something that partly simulates the Substitute mechanic, and it even sounds like you've found what you needed, so I won't go into any more detail.
That is fine. Any suggestions are welcome.