Is there any way to remember stat changes?

Sorry for any mistakes, first post.

So my idea would be that in the game, there would be two stats that are affected by player choice and affect the story progession. For the time being those two stats are 'law' and 'chaos'.

However besides having the current value of the stat matter, I also want the highest the stat ever went to also matter. Something along the lines of "You're current law score is 20 but it used to be 80 so that's going to change the story then if you're highest would have been 20.

is there any way to implement this system into a game?
Switches and variables.

I'm not 100% sure on your post it isn't very clear to me. but what i think you could do with is applying conditional branches and switches Say If -player stat is more then or equal to say 50 in this case LAW then apply this switch.. you can also use variables to do checks on this stuff it's great for numbers. and you can then apply conditional branches and switches with that.

Edit: I think what your saying now is that you want the game to remember that your stat was 80 but it's not anymore and because of that it changes story.
this would be 4 variables
law
highest law
chaos
highest chaos

every event that increases law or chaos will then also need to check the current law/chaos variables vs the highest law/chaos variables and if current is more then the highest just update the highest

after that its just conditionals checking the relevant variable

Original thread: https://forums.rpgmakerweb.com/threads/is-there-any-way-to-remember-stat-changes.129999/