Retaliation Skill

So I had an idea about a skill that I wanted to make. I want to make a retaliation skill that if a party member gets hit by another party member, they deal either the same or more damage to an enemy. How would I go at doing that? Thanks for any help.
I want to make a retaliation skill that if a party member gets hit by another party member, they deal either the same or more damage to an enemy.
So actor A attacks actor B, and then actor B performs a counter attack on some enemy based on the damage they took? Or is it a skill the player actively chooses?

I could see it being doable with yanfly's buffs & states (and perhaps auto passives). Youd create a state to track damage taken from allies using a <custom react effect>, and then use that value in the damage formula for the skill.
If its a counter, you might have to use yanfly's counter control or some other counter plugin to have the actor do it on an enemy as a response to being hit by an ally. I can't remember if the default counter system would allow it.
So actor A attacks actor B, and then actor B performs a counter attack on some enemy based in the damage they took? Or is it a skill the player actively chooses?
It is a skill the player chooses. So they choose the skill and then will have another player attack them. When the other actor hits them, the damage will be done and then they will hit a random enemy for the same damage or more.
So the first skill could be self scope and just place a state on the user

That state could use a <custom react effect> note tag that uses a conditional to save the damage dealt by incoming damage from allies, and then force them to use an attack on a random enemy with a formula that uses that value.

I am on my phone and it doesn't let me use the forum inline shortcuts, so I wont bother with them
The contents of the react tag would look something like this

If (this.isForFriend() && this.isDamage())
{
target._retaliation = value;
BattleManager.queueForceAction(target, 999, -2);
}

And your replace the 999 with the ID for a second skill. That skill would be the actual attack and will use a._retaliation in its

Granted, you don't need the second skill and could just make the state deal damage to a random enemy directly if you just wanted the damage, but you did mention the actor hitting them
Hmm. So your party has members Adam and Body... and you meet evil Xyclon. And you make Adam to attack Body, because Body has the retaliation skill, so Body will attack Xyclon in anger. Right? Strange but possible I guess.

I believe that Body would have to get some State with Restriction "Attack an Enemy" because that means attack a random enemy. So I would give him such State for one turn with some buffs to the attack and that could do the trick.

Do you need more detail or did I misinterpreted your idea entirely?

Also just to fill in on Robro33: Yenfly's wiki of that plugin
Hmm. So your party has members Adam and Body... and you meet evil Xyclon. And you make Adam to attack Body, because Body has the retaliation skill, so Body will attack Xyclon in anger. Right? Strange but possible I guess.

I believe that Body would have to get some State with Restriction "Attack an Enemy" because that means attack a random enemy. So I would give him such State for one turn with some buffs to the attack and that could do the trick.

Do you need more detail or did I misinterpreted your idea entirely?

Also just to fill in on Robro33: Yenfly's wiki of that plugin
That might work, but my question then becomes how do I make the attack do damage equal to or greater than the amount of damage that Body took from Adam?
That might work, but my question then becomes how do I make the attack do damage equal
And that is the part where you need the advise from

Robro33.​

The Yanfly's plugin quite possibly does it.

Original thread: https://forums.rpgmakerweb.com/threads/retaliation-skill.170033/