MV Augmentation Determining Variable Affected Based on Actor

My interest is to get an augmentation when added and removed to tick up a variable.
I got it to work so far:

<Augment Attach Eval: Sigil>
$gameVariables.setValue(101, $gameVariables.value(101) + 1);
</Augment Attach Eval: Sigil>

<Augment Detach Eval: Sigil>
$gameVariables.setValue(101, $gameVariables.value(101) - 1);
</Augment Detach Eval: Sigil>

However, I'd like to change which variable changes based on whether it's actor 0, 1, 2, or 3 and so on.
Plugin I'm Using: Yanfly Attachable Augments
However, I'd like to change which variable changes based on whether it's actor 0, 1, 2, or 3 and so on.
The problem is: whether what is actor 1 (there's no such thing as actor 0), 2, 3, or so on?

Items do not need to be equipped to an actor in order to be augmented, and even if they are there's no reference on the item for which actor has it equipped.

You can try something like this
Code:
let actorId = 0;
$gameParty.members().forEach(actor => 
{
    if (actor.equips().some(equip => {equip && equip == item}))
        actorId = actor.actorId();
});

let varId = actorId > 0 ? actorId : 101;
$gameVariables.setValue(varId, $gameVariables.value(varId) + 1);

That should (I haven't tested it) check whether any actor is equipping the item being augmented, and if yes, use their ID as the variable ID to be incremented; if it's not equipped by anyone, it uses variable ID 101.

If you don't have variables in a row starting at 1 to use for this, just do math to the middle part of the ternary statement. e.g. actorId > 0 ? actorId + 150 : 101 will make the variables (if an actor is equipping it) start at 151, 152, etc.
The problem is: whether what is actor 1 (there's no such thing as actor 0), 2, 3, or so on?
Oh, yeah, I dunno why I thought Actors started at 0...

--
So far, it seems as though inputting the code formatted as such:

<Augment Attach Eval: Sigil>
let actorId = 0;
$gameParty.members().forEach(actor =>
{
if (actor.equips().some(equip => {equip && equip == item}))
actorId = actor.actorId();
});
let varId = actorId > 0 ? actorId : 101;
$gameVariables.setValue(varId, $gameVariables.value(varId) + 1);
</Augment Attach Eval: Sigil>
And Detach Sigil
$gameVariables.setValue(varId, $gameVariables.value(varId) - 1);

Results in only affects Var 101 with using Actor 2.

Original thread: https://forums.rpgmakerweb.com/threads/augmentation-determining-variable-affected-based-on-actor.172666/