All right, please bear with me as my solution involves utilizing four parts of the database: skills, states, common events, and troop events. It will center around Yanfly's "Bide" tips and tricks code, with a modification I made to ensure that there is a 3-turn damage cap. My solution is probably not the most efficient one out there, as that would probably require more complex scripting with less eventing, but if you're okay with my solution, here is how it goes:
First, you'd want to create your
Skill. It's not meant to do anything other than to "release" your revenge state.
Then, on to the
state itself. This is where we implement and modify Yanfly's "Bide" code in the notebox section. My modification involves adding a counter variable that increases by 1 each time the user takes damage
if the counter has not yet reached past 3. Code below the picture.
Code:
<Custom Apply Effect>
// Upon applying Bide, set the Bide damage to 0.
user._bide = 0;
counts = 0;
</Custom Apply Effect>
<Custom Respond Effect>
// Check if the target took any HP damage. + Add DAMAGE CAP to 3 turns
if (target.result().hpDamage > 0 && counts <= 3) {
// If the target did, raise the Bide damage by the HP damage taken.
target._bide += target.result().hpDamage;
counts += 1;
}
</Custom Respond Effect>
<Custom Remove Effect>
// Check if the party is in battle.
if ($gameParty.inBattle()) {
// Play animation 97 on the user.
user.startAnimation(97);
// Calculate the damage. The damage dealt is equal to 2x Bide damage.
var damage = Math.ceil(user._bide * 2);
// Get the group of alive enemies.
var enemies = user.opponentsUnit().aliveMembers();
// Loop through each of the enemies.
for (var i = 0; i < enemies.length; ++i) {
// Get the enemy.
var enemy = enemies[i];
// Play animation 107 on the enemy.
enemy.startAnimation(107);
// Make the enemy take damage.
enemy.gainHp(-damage);
// Prompt the enemy's damage popup.
enemy.startDamagePopup();
// Clear the results of the enemy taking damage.
enemy.clearResult();
// Check if the enemy is dead.
if (enemy.isDead()) {
// If the enemy is dead, make it collapse.
enemy.performCollapse();
}
}
// Reset the Bide damage value.
user._bide = 0;
counts = 0
} // Check if the party is in battle.
</Custom Remove Effect>
After, we create a
Common Event that will run at the end of every turn (which will go in
Troop Events). This will refresh the user's "Revenge" state, allowing him to use it again and again throughout the battle. If you can make this work with Yanfly's Passive States, you could perhaps get rid of these steps. However, I wasn't able to make it work in the limited time that I had making this, so my apologies for that.

Let me know how it goes, and goodluck with your project!