MZ How to make a switch stay on if you have a game over / close the game?

I want a switch to go on if something happens, but if the player has a game over or closes the game it would not work and it would cause cheese. Is there anyway for a switch to be added directly to the save file?
Edit: Found this MZ plugin.

If you want to force an autosave you can follow this thread
Moved to: Plugin Requests
Edit: Found this MZ plugin.

If you want to force an autosave you can follow this thread
Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-switch-stay-on-if-you-have-a-game-over-close-the-game.158238/