Help getting variables to stack independently for each enemy

Hi everyone,

I'm using RPG Maker MZ and most Visustella plugins.

I want to make a skill that the player use's and it forces a single enemy to escape after the variable from the attack is applied 3 times, while other enemies are not affected.

I have been able to create this skill and have it affect all enemies in the battler using states, common events, variable, and Visustella action sequencing.

The problem I have encountered is making the variable and flee enemy specific, and not universal to all enemies. So, each enemy would need it's own variable to track and then to trigger the individual enemy to flee.

In Summary:
-A skill that applies a variable to each enemy independently.
-at 3 stacks of this variable on an enemy, that specific enemy will escape combat.

Are there any plugins to allow for this? Is this even possible?

Coding is a bit outside my skill set, but I can follow a templet, modify things on a very basic level, or follow a tutorial.

I've included pictures of the skill I created that causes all enemies to flee when the variable reaches a stack of 3.

Thanks for taking the time to read this!
In Summary:
-A skill that applies a variable to each enemy independently.
-at 3 stacks of this variable on an enemy, that specific enemy will escape combat.
if you wanted to event it, you could store the target's enemy index to a variable, then manipulate one of 8 variables since at most theres 8 enemies in an encounter, and then if their variable hit 3 force them to escape. but...
and most Visustella plugins
with visustella's battle core you can try this as in the notebox of the skill

Code:
<JS Post-Apply>
target._befriend = (target._befriend + 1) || 1;
if (target._befriend >= 3)
  target.escape();
</JS Post-Apply>
AMAZING! Thank you so much Robro33!
It took me fixing some errors from how I typed it in, but it works beautifully.

Original thread: https://forums.rpgmakerweb.com/threads/help-getting-variables-to-stack-independently-for-each-enemy.179855/