Passive leader skill using Auto Passive State & Base Parameter Control not working out...

So, I want to make a "passive leader skill" with the following criteria:

1. It's active only when a specific character is the "leader" & that character is alive. (they are always member #1 in the party)
2. The skill usually does something based on the leader's level (raises atk by leader level for example)
3. The skill should effect each character in the party.

I'm currently using Yanfly's Auto Passive State & Base Parameter Control Plugins. I set my 5th variable upon character selection as leader so that it reflects the actorId of the chosen character. Below are my attempts at creating a leader skill for my first character that increases the atk by his level. I also set the actor passive list for the auto passive state plugin to have state 7, this state, as always set.


Spoiler: State Notetag Attempt #1
var characterLevel = $gameActors.actor(1).level;
<atk Plus: +characterLevel>
<Custom Passive Condition>
if ($gameVariables[5] == 1 && $gameParty.members()[0].isAlive()) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>

State doesn't apply.

Spoiler: State Notetag Attempt #2
var characterLevel = $gameActors.actor(1).level;
<atk Plus: +characterLevel>
<Custom Passive Condition>
if ($gameVariables[5] == 1) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>

State doesn't apply... must be something I'm doing wrong on the condition...

Spoiler: State Notetag Attempt #3
var characterLevel = $gameActors.actor(1).level;
<atk Plus: +characterLevel>

State applies but nothing happens.

Spoiler: State Notetag Attempt #4
<atk Plus: +1>

State applies and atk increases by 1.

So, thoughts on what I might be doing wrong around the condition? Also, is it even possible to use a variable in the base parameter control notetag command like that? Any other ideas on how I can accomplish the same goal?

Thanks in advance!
Two things.
1. <> notetags do not accept variables. Only raw values. The reason why is because they are treated by the plugin as regular expressions, meaning "+characterLevel" is treated as a string and not a variable. That string gets converted to a number, but since conversion of "characterLevel" to a number is impossible, because these are letters, it returns null, in other words no value.
2. You need to use either $gameVariables._data[x] or $gameVariables.value(x).
@Poryg thanks for explaining that. I figured I wasn't able to pass a variable like that... it's unfortunate, but I'll have to figure something else out. Perhaps I can play with the Troop events a bit to detect when I have state to do this math for me. Change Parameter could handle the variable piece. Just gotta set the leader level initially & each time they level...something like that.

Original thread: https://forums.rpgmakerweb.com/threads/passive-leader-skill-using-auto-passive-state-base-parameter-control-not-working-out.85747/