[Help] Random Variable Storage and Comparison?

Hello, before I ask for help I should explain exactly what I am hoping to achieve.

I have been attempting to create various recruitable mercenaries with 'unique' personality quirks that are displayed for as long as they remain in your party before they are either fired, killed, or run out of time. To do this, I have various variables relating to personality parameters, these parameters determine what dialogue they will use.

For example; a character with a randomly generated variable for confidence exceeding 500 will speak in a more self-assured way. However, these replaceable allies personalities change over the course of the game depending on who you hire and what you have them do, and I'd like to be able to tell when a personality variable is changed from what was initially generated.

If Actor A is randomly generated friendliness of 15, making them not very sociable but over the course of the game they are more friendly I would like to be able to tell in order to write more dialogue to have other characters comment on this change. Which is not something I have figured out how to do with eventing, at least not without ungodly amounts of checks for every number from 1 to infinity every single time one of these events would occur. Surely there must be an easy way to achieve this?

In simpler terms; if the game starts off with Variable B having a value of 3, and by the end of the game Variable B now has a value of 17 I would like to have some sort of call available to tell this change has occurred. I can elaborate further on specifics if needed, even if you can't help I appreciate you taking the time out of your day to read my inane rambling.
Why don't you set all the initial stats as one variable and then have another variable that tracks the changes?
How would I go about doing that Though largely I am looking for something that can be called upon the same way as a conditional branch, the simplest functionality I can work with being "does [variable number] currently match [variable value]"

My main problem here is that the value of the variable is randomly selected, meaning I can't check if the new amount is larger or smaller than the previous amount since I have no way of measuring what that previous number even would be.
I'm not sure what the criteria is for a thread to become locked, but I am posting again just to show that I am still looking for a solution to this problem.
It depends on how many allies you have and how many stats you have, but I would set one variable per ally to be their starting stat and another to track their changes. So you would randomise the first variable, then set the second variable to be equal to that and then add to it as the game goes along. Then you can check if variable 1 - variable 2 (the difference) is greater than or equal to X, for example, and then set dialogue accordingly.
When the mercenary character is created/recruited, set their initial stats into one variable (per stat) and also set those initial stats into a second variable (per stat): for example, Variable #11 is Marcus Initial Friendliness, Variable #12 is Marcus Current Friendliness (which will be the same as initial when first created), Variable #13 is Marcus Initial Courage, Variable #14 is Marcus Current Courage, etc. for each personality trait and for each mercenary.

When you want to check the change in a character's personality (to, for example, show different dialogue), all you need to do is subtract the initial variable from the current variable. For example, if the check is for the change in Marcus' friendliness, you would set a temporary holder variable (let's say Variable #107 "Temporary Calculation Holder") equal to Variable #12 (Control Variables: Var 107, Set, Var 12), then subtract Variable #11 from that amount (Control Variables: Var 107, Subtract, Var 11). If Marcus' friendliness has grown from 3 to 17, the result pf this would be +14. Then you could have a conditional branch based off of the new value of Variable #107 - for example, if the value (that is, the change from the beginning) is greater than 10, the NPC will say "By the way, Marcus, somehow I feel a lot closer to you now." Else, if the variable is less than -10 (the friendliness has gone down by 10 or more), the NPC will say "What's the matter with you, Marcus? You used to be cool." Else (if neither is true), the NPC will just say their normal dialogue.

If you have some kind of Script that you're using to generate mercenaries in the first place, adding the personalities into that script as properties of the Mercenary object (rather than as game variables) would be a much cleaner way to do it.
Thank the both of you, that was extremely helpful.

Original thread: https://forums.rpgmakerweb.com/threads/help-random-variable-storage-and-comparison.128278/