MV [Yanfly] custom option not displaying correctly

I was adding a custom difficulty option to my game that made use of gauges, and I reused the audio code from Yanfly's option core in an attempt to make it easier on myself, but for some reason, instead of displaying the value of the current % like the audio settings, it instead displays "off" when the gauge is completely empty, or "On" when it's partially or fully filled. as seen below
Spoiler: incorrectly displayed option
1687075032842.png

1687075050180.png

while the option itself still functions properly, this is still annoying and I would like some help with this. below is the information/code for this option, if anyone knows how I messed up, please inform me so I can fix it.

Spoiler: code
JavaScript:
//Symbol
CostOfRetry

//show/hide
show = true;

//Enable
enabled = true;

//Ext
ext = 0;

//Make option code
this.addCommand(name, symbol, enabled, ext);

//Draw option code
var rect = this.itemRectForText(index);
var statusWidth = this.statusWidth();
var titleWidth = rect.width - statusWidth;
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
this.drawOptionsName(index);
var value = this.getConfigValue(symbol);
var rate = value / 100;
var gaugeColor1 = this.textColor(3);
var gaugeColor2 = this.textColor(11);
this.drawOptionsGauge(index, rate, gaugeColor1, gaugeColor2);
this.drawText(this.statusText(index), titleWidth, rect.y, statusWidth, 'center');

//Process ok code
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value += this.volumeOffset();
if (value > 100) {
  value = 0;
}
value = value.clamp(0, 100);
this.changeValue(symbol, value);
$gameVariables.setValue(113, value);

//process right code
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
var index = value;
value += this.volumeOffset();
value = value.clamp(0, 100);
this.changeValue(symbol, value);
$gameVariables.setValue(113, value);

//process left code
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value -= this.volumeOffset();
value = value.clamp(0, 100);
this.changeValue(symbol, value);
$gameVariables.setValue(113, value);

//default config code
ConfigManager[symbol] = 50;

//save config code
config[symbol] = ConfigManager[symbol];

//load config code
var value = config[symbol];
if (value !== undefined) {
  ConfigManager[symbol] = Number(value).clamp(0, 100);
} else {
  ConfigManager[symbol] = 100;
}

Also, while not part of my issue, i would also like some help changing how much the gauge increments when inputting left/right/ok. currently, it increments by 10, but I would like it to increment by 5. This would actually be useful for the other gauges in the options menu, but this one is the one I believe it's most important for.
Quick fixes:
  1. Replace this.statusText() with this.volumeStatusText().

  2. Replace this.volumeOffset() with 5.

    • Alternatively, I have a plugin called Cae_VolumeChange here (in the "General" category):
Quick fixes:
  1. Replace this.statusText() with this.volumeStatusText().

  2. Replace this.volumeOffset() with 5.
    • Alternatively, I have a plugin called Cae_VolumeChange here (in the "General" category):
1. this made things slightly better, but now it seems to only display "6%" I tried to remake the entry option by copy and pasting, then changing the symbol to see if it was some sort of issue with changing an already existing option, and that changed the "6%" to "12%", though after messing around with the option and restarting the game, it went back to 6% and won't go back.
1687107363946.png


2. Thank you for the help with that! it works perfectly.
Oops, I should have written that as:
  1. Replace this.statusText(index) with this.volumeStatusText(index).
[Edit: actually it should be this.volumeStatusText(value). 😴]

If that doesn't work, try replacing it with value + "%" instead, i.e.
JavaScript:
this.drawText(value + "%", titleWidth, rect.y, statusWidth, 'center');
Oops, I should have written that as:
  1. Replace this.statusText(index) with this.volumeStatusText(index).
If that doesn't work, try replacing it with value + "%" instead, i.e.
JavaScript:
this.drawText(value + "%", titleWidth, rect.y, statusWidth, 'center');
I tried the former already as when i tried the original version you sent I simply got "Undefined%",
however your new code seems to have fixed everything! So thank you for all the help!
1687110316088.png
This thread is being closed due to being solved. If you would like it reopened, report it to let us know why. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-custom-option-not-displaying-correctly.158447/