Tying Variables to actors?

I'm working on an enemy skill that when it hits an actor, increases a variable by 1. This variable is tied to an actor, so that each of the game's three actor's has a unique counter. We'll call this the Tag variable.

This would then cause the enemy's attack to scale depending on the number of Tags that actor had received during the previous battles.

What I can't figure out is how to create the branch point so that each actor's Tag variable is referenced when the enemy makes the attacks that factor in these three Tag variables.

I hope I phrased that in a sane way? Thanks.
These "tag variables" are just game variables, as used in the Control Variables command, right?

If the "tag variable" for actor ID X is variable ID 10 + X, then you could have a formula like:
JavaScript:
50 + 100 * (b.isActor() ? $gameVariables.value(10 + b.actorId()) : 0)
I.e. "50 damage, plus 100 damage times the value of the target actor's tag variable (0 for non-actors)".
These "tag variables" are just game variables, as used in the Control Variables command, right?

If the "tag variable" for actor ID X is variable ID 10 + X, then you could have a formula like:
JavaScript:
50 + 100 * (b.isActor() ? $gameVariables.value(10 + b.actorId()) : 0)
I.e. "50 damage, plus 100 damage times the value of the target actor's tag variable (0 for non-actors)".
Ah, that worked as intended. Thanks!

I was looking through the damage formulas. Is there a code I can enter that will use that same formula to increase those variables?
You may find this thread useful:

However, note: if you have skills that are used by enemies, or if you use the auto battle trait in your game, things like increasing variables should not be done in the damage formula.

The damage formula is executed when the AI is determining which skill to use, so any code in it will be done then, even if the skill isn't actually used (and then executed again if it is).

For things like this, it's better to use a plugin like Yanfly's Skill Core. You could give your skill the notetag:
Code:
<After Eval>
if (target.isActor())
    $gameVariables.setValue(10+target.actorId(), $gameVariables.value(10+target.actorId())+1);
</After Eval>

However, if you go that route, it's even more efficient to not use up any of your game variables and just store the data on the actor directly.

Code:
<After Eval>
target.tagVar = target.tagVar || 0;
target.tagVar++;
</After Eval>

then your damage formula:
Code:
50 + 100 * (b.tagVar ? b.tagVar : 0)

Original thread: https://forums.rpgmakerweb.com/threads/tying-variables-to-actors.162156/