MV Is there any possible way to keep an variable stored even closing the game?

I don't know at all but i think that for this working i'll need somehow an text file that stores the variable value, i didn't find anything about it externally, but i want to know if there's any plugin/script call that can make it, it is for my custom menu, but i was thinking about and you can do really creepy games, that pretends to be normal but then some npc says something that the player did, and thinked that restarting the game and the save file would erase it, cool idea, please let me know if there's some possible way to do it.
It is possible if you know Javascript well enough. I can't tell you how, though.

But you can get the result you try to create using a new game+ plugin. This well restart the game, but keep some on the switches and variables as they are before restarting.

Yanfly has a plugin for this, but I know there are more.
This kind of thing?
this might be helpful https://forums.rpgmakerweb.com/inde...de-js-part-1-reading-and-writing-files.80140/
I think it worked with Sync Save Data, Thanks @caethyril
Olivia_MetaControls for one that can save this nicely.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-any-possible-way-to-keep-an-variable-stored-even-closing-the-game.150496/