Limit Party Size Based on Difficulty?

At the start of the newest shiny thing I've begun to hyperfixate over "a side-project i've started," the player picks between one of 3-and-a-half difficulties, each granting the player access to different amount of active members at the start of combat.

I know how to just completely lower the hard limit at all times, but what I don't know is if I can change it through a script call placed in parts of a branching autorun event at the start of a new game.
Instead of replacing the 4 with a number, you replace it with
$gameVariables.value(99)
where 99 (example) is the ID of the variable you choose to reserve for this.

then you can use control variable in an event to change the number of battlemembers dynamically in game.
Just aside: Party size is always unlimited and consists of Party = Battlemembers + Reserve Members
you only change the number of Battlemembers in the party with that function.

That difference is important with some commands....


EDIT:
And remember: updating your project will replace all core scripts with the default ones, although MV is legacy and will not receive updates anymore.
But if you ever use a current maker, it's better to make the change as a plugin than an edit.

Original thread: https://forums.rpgmakerweb.com/threads/limit-party-size-based-on-difficulty.160313/