Ingame change "gold" word ("G") through script.

Is there a way to change the name for "Gold", the one assigned from the database during the gameplay through a script? Like from "G" to "Credits" ?
You can use this in a Script command:
JavaScript:
$dataSystem.currencyUnit = "Credits";
However, note that this change applies to $dataSystem, which is part of the database stuff. It won't change the actual database files, but it will persist through the entire session (e.g. if you make a new game, the new unit will still be there), and will not be saved in save files. Seems you can't just use \V[X] for the currency unit, either... 😔

Suggestions:
  1. A plugin specifically for this purpose:
    Spoiler: Plugin code
    JavaScript:
    /*:
     * @plugindesc Change the currency unit mid-game~
     * @help Script commands:
     *   Change unit to "Credits":
     *     $gameSystem.currencyUnit = "Credits";
     *   Revert to original database value:
     *     delete $gameSystem.currencyUnit;
     */
    Object.defineProperty(TextManager, 'currencyUnit', {
      get: function() { return $gameSystem.currencyUnit || $dataSystem.currencyUnit; },
      configurable: true
    });
    Save the above code as a .js file (Save As > File type: All Files, Filename: whateverYouLike.js) and import it as a plugin. It says "the currency unit is the one defined on $gameSystem, unless that doesn't exist (yet) in which case refer to the database". Then you can use this in a Script command instead:
    JavaScript:
    $gameSystem.currencyUnit = "Credits";
    This ought to work properly because the $gameSystem is included in save files. Also, if you want to revert to the original currency unit as defined in the database, you can use this script call:
    JavaScript:
    delete $gameSystem.currencyUnit;
    😤

  2. Alternatively, you could get a plugin that lets you run events on game load, e.g. Kadokawa's SwitchOnLoad (check the dlc folder in your RMMV install path). This would let you assign the correct currency unit name whenever the player enters the game: new game (Autorun) or load game (event from plugin).

Original thread: https://forums.rpgmakerweb.com/threads/ingame-change-gold-word-g-through-script.122794/