Character Synergy Boosts? Or variable based on stats?

Bold blue part is why I want to do this, and then the bold green part is just the question itself. Just skip to the question if you don't care.

My game has 16 different characters (planned, might be more, might be less).

I'm using many different ways to encourage players to use different characters, but for the most part players will only use these characters when it gives them a major benefit, big enough for them to temporarily drop their super-upgraded characters for these maybe less-upgraded characters. So it's nothing long-term. I was thinking one way to really make players use these other characters for a long-term amount of time would be this "synergy" system. It would boost one character's stat by an amount based off another character's stat. I know how to do most of this, however the only big thing I'm missing is...


How would I do that a stat increases a variable by a certain amount? For example, one character's luck would increase this variable by 1 for each 4 luck. Or would it at least be possible increase this variable by 1 for each luck point. I have an alternative, that would completely change how this "synergy" system would work, but it wouldn't be as good as this one in my opinion. The rest I know how to do.
You sound like you've already thought about this a bit so I'll give you some Script calls to try without too much explanation. In any Event (map, troop, or common) you can try these to see if it will help.

Code:
var x = 1; //Variable number you wish to set
var a = 2; //Actor number to use
var d = 4; //Denominator of the fraction where every 4 luck is 1 value

$gameVariables.setValue(x, $gameActors.actor(a).luk/d);
//"Sets" the value of Variable 'x' to the Luck of Actor 'a' divided by 'd'

Code:
var x = 1; //Variable number you wish to set
var a = 2; //Actor number to use
var d = 4; //Denominator of the fraction where every 4 luck is 1 value

var val = $gameVariables.value(x);
$gameVariables.setValue(x, val + $gameActors.actor(a).luk/d);
//"Adds" the Luck of Actor 'a' divided by 'd' to the value of Variable 'x'

I believe that by default it rounds down any fractions.
You sound like you've already thought about this a bit so I'll give you some Script calls to try without too much explanation. In any Event (map, troop, or common) you can try these to see if it will help.

Code:
var x = 1; //Variable number you wish to set
var a = 2; //Actor number to use
var d = 4; //Denominator of the fraction where every 4 luck is 1 value

$gameVariables.setValue(x, $gameActors.actor(a).luk/d);
//"Sets" the value of Variable 'x' to the Luck of Actor 'a' divided by 'd'

Code:
var x = 1; //Variable number you wish to set
var a = 2; //Actor number to use
var d = 4; //Denominator of the fraction where every 4 luck is 1 value

var val = $gameVariables.value(x);
$gameVariables.setValue(x, val + $gameActors.actor(a).luk/d);
//"Adds" the Luck of Actor 'a' divided by 'd' to the value of Variable 'x'

I believe that by default it rounds down any fractions.

Seems like it'd do exactly what I want. This is to control the variable, correct? Thank you very much for your help though, I really do appreciate it!
Yes, doing it the way above will set or add value for whichever game variable you wish. Then, you can read/check/control the variable just like usual in event commands.

Original thread: https://forums.rpgmakerweb.com/threads/character-synergy-boosts-or-variable-based-on-stats.88168/