Icon as/replacing parameter name

I would like to use icons for parameter names/be able to replace the text name with an icon, in particular HP, MP, and TP, sorta like the image below
/i[#] doesn't work because the engine reads it as a string I suppose, and VisuStella applies to all stat names except HP/MP/TP and is obfuscated so one can't edit it easily
1718776353644.png
Welcome!

/i[#] doesn't work because the engine reads it as a string I suppose
The name you type in is a string, also 😉

However, in RPG Maker, text is processed in two ways - one that reads for escape codes and one that doesn't. By default, only text typed into Show Text gets the escape codes processed.

But you can install a plugin which changes that, such as:
Oh this is exactly what I needed, except it works for everything except the HP/MP/TP/EXP fields in the Terms tab 🙁
You could ask @Eliaquim about adding that.
Note: it's \backslash\, not /forward slash/, e.g. \i[123]. However...

Game windows have a built-in function to handle text codes, but sprites don't. That makes it much more awkward to support all text codes for stuff like gauge labels and name sprites (battle status).

It's possible to support text codes in general by e.g. creating a dummy window and using that to process the text before transferring it over. But I think it'd be simpler in your case to just manually interpret \i[n] by patching the drawLabel method of Sprite_Gauge. Maybe (untested):
Spoiler: plugin code
JavaScript:
/*:
 * @target MZ
 * @plugindesc Show icons for \i[n] gauge labels.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/169619/
 * @help Free to use and/or modify for any project, no credit required.
 */
;void (alias => {
  const RX = /^\\i\[(\d+)\]$/i;
  Sprite_Gauge.prototype.drawLabel = function() {
    const m = RX.exec(this.label());
    const n = m ? parseInt(m[1], 10) : 0;
    if (n) {
      // cf Window_Base.prototype.drawIcon
      const bmp = ImageManager.loadSystem("IconSet");
      const pw = ImageManager.iconWidth;
      const ph = ImageManager.iconHeight;
      const sx = (n % 16) * pw;
      const sy = Math.floor(iconIndex / 16) * ph;
      const x = this.labelOutlineWidth() >> 1;
      const y = this.labelY();
      this.bitmap.blt(bmp, sx, sy, pw, ph, x, y);
    } else
      alias.apply(this, arguments);
  };
})(Sprite_Gauge.prototype.drawLabel);
Then (in theory) just enter, like, \i[123] for the HP abbreviation under Database -> Terms.
Thank you for trying to help but it did not work
OK, I tested and fixed a couple of things, this seems to work for me: 👋
Spoiler: plugin code v2
JavaScript:
/*:
 * @target MZ
 * @plugindesc Show icons for \i[n] gauge labels (v2).
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/169619/
 * @help Free to use and/or modify for any project, no credit required.
 */
;void (() => {
'use strict';

  /** Regular expression for matching icon labels. */
  const RX = /^\\i\[(\d+)\]$/i;

  /** One-sided X-padding for icon labels. */
  const PX = 0;

  // Patch - check for icon labels.
  const alias = Sprite_Gauge.prototype.drawLabel;
  Sprite_Gauge.prototype.drawLabel = function() {
    const m = RX.exec(this.label());
    const n = m ? parseInt(m[1], 10) : 0;
    if (n) {
      // cf Window_Base.prototype.drawIcon
      const bmp = ImageManager.loadSystem("IconSet");
      const pw = ImageManager.iconWidth;
      const ph = ImageManager.iconHeight;
      const sx = (n % 16) * pw;
      const sy = Math.floor(n / 16) * ph;
      const x = PX + this.labelOutlineWidth() >> 1;
      const y = this.labelY();
      this.bitmap.blt(bmp, sx, sy, pw, ph, x, y);
    } else
      alias.apply(this, arguments);
  };

  // Override - correct label width for icon labels.
  Sprite_Gauge.prototype.measureLabelWidth = function() {
    this.setupLabelFont();
    const labels = [TextManager.hpA, TextManager.mpA, TextManager.tpA];
    const f = s => RX.test(s)
            ? ImageManager.iconWidth + PX * 2
            : this.bitmap.measureTextWidth(s);
    return Math.ceil(Math.max(...labels.map(f)));
  };

})();
It might conflict with other plugins you're using, though.
Thank you so much! It's lovely 😍

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/icon-as-replacing-parameter-name.169619/