MV How to save javascript variables value ?

I prefer using my own variables rather than the game variables for two simple reasons: it's easier to make complex conditions via script and they can have a name I remember and understand easily.
But I noticed the save didn't save the value of my variable and didn't restore it when you load your save which is a major issue.
Is there an easy fix for this ?
Thank you.
Look at rpg_manager.js
Look for "makeSaveContents" function.
Add yours there, make it a new plugin.
JavaScript:
DataManager.makeSaveContents = function() {
    // A save data does not contain $gameTemp, $gameMessage, and $gameTroop.
    const contents = {};
    contents.system = $gameSystem;
    contents.screen = $gameScreen;
    contents.timer = $gameTimer;
    contents.switches = $gameSwitches;
    contents.variables = $gameVariables;
    contents.selfSwitches = $gameSelfSwitches;
    contents.actors = $gameActors;
    contents.party = $gameParty;
    contents.map = $gameMap;
    contents.player = $gamePlayer;
    return contents;
};

Original thread: https://forums.rpgmakerweb.com/threads/how-to-save-javascript-variables-value.142243/