MV Skill description that always refreshes

This is a very specific thing but maybe someone can find a simple plugin solution...

Context:
I want to make a skill that adds a state to the user. The state would make their attacks be fire type from then on.
This state would expire after a number of attacks have been used. This I figured out with variables and common events, that part works fine and is not important.

The important part comes here:
Everytime the state is applied, a variable is edited to contain a string: "fire".
Everytime the state is removed, the variable is edited to contain the string: "normal".
With this variable, I thought it would be nice to add it to the skill description so the player would know the current type (without relying on state icons, this is important for me).

"Current type: \v[20]"

I have tested this and it works, but there's a big but: imagine you apply the state and change the string to "fire" in one turn, and then open the skill list the next turn. Your cursor starts on top of this skill, and instead of showing the actual current type (fire) it shows "normal". If you move your cursor to another skill and then move it back, it will say "fire" as it should. So the problem here is that it doesn't refresh the first time, but it does the second...

This is very annoying. Does someone know what is causing this?
usually the help window doesnt refresh if the text for the current skill description doesnt actually change from the previous one it displayed. This wouldnt include variable content, just the description content.
I havent tried it, but try this as a plugin and it should make it always refresh

Code:
Window_Help.prototype.setText = function(text) {
    this._text = text;
    this.refresh();
};
usually the help window doesnt refresh if the text for the current skill description doesnt actually change from the previous one it displayed. This wouldnt include variable content, just the description content.
I havent tried it, but try this as a plugin and it should make it always refresh

Code:
Window_Help.prototype.setText = function(text) {
    this._text = text;
    this.refresh();
};
Hello, thank you very much for the reply! Unfortunately this didn't work, but thanks to your pointer I got it working!
Apparently this setText is not called all the time you open the skill menu (?), so I searched for another place where to slap a refresh() lol

I'm not sure if it's a stupid fix (like, if it could give me problems of some kind) but for now I have it like this:

JavaScript:
Window_Selectable.prototype.showHelpWindow = function() {
    if (this._helpWindow) {
        this._helpWindow.refresh(); //added this line here
        this._helpWindow.show();
    }
};

I figured that it refreshing everytime it needs to get shown would do the trick. But if there's a better way, I'm open to suggestions lol
the menu does refresh when you open it, and so does the helpfile.
as I use my description like: \JS{$gameVariables.value(33)} and show
the text in there or an eval on that.

or a string text, and change this also changes the description of it.
if its more dynamicly while "on the scene" when changing the description,
than it may not work, as scene wont refresh while alter things inside the menu.
(except for item usage) to refresh the amount left.

but it also depends on the on your exact goal what you achieve, and for what.
the menu does refresh when you open it, and so does the helpfile.
as I use my description like: \JS{$gameVariables.value(33)} and show
the text in there or an eval on that.

or a string text, and change this also changes the description of it.
if its more dynamicly while "on the scene" when changing the description,
than it may not work, as scene wont refresh while alter things inside the menu.
(except for item usage) to refresh the amount left.

but it also depends on the on your exact goal what you achieve, and for what.
I'm not sure I completely follow here...
Is the \JS{} thing a plugin you have? (If not, I didn't know that was possible, haha)

For my use case I won't really let the player alter variables while in the menu and staying there, it's always select skill -> skill is used (hence you leave the menu), and it manipulates variable -> next time you open the menu, the variable is already changed -> the variable is visible in the skill's description

So really, the snippet I showed does the trick, I simply force it to refresh in a place I tried and worked, instead of showing the last thing it showed before. I'm sure it could work a different way, lolz, but this is the first place I found that worked.
I'm not sure I completely follow here...
Is the \JS{} thing a plugin you have? (If not, I didn't know that was possible, haha)
its in my MV base, I can't check if it works in MV... as there are other that may do
similar.

forcing the refresh while in menu is once way, but if menu closes upon using
the item/skill/etc, it should refresh inside the menu as the map refreshes on
menu closing.

if the menu stays open, than refresh can work out there, but I don't know if it
have any side effect in the long run (you can test it to see), but my guess, probably not.

otherwise, you can make an additional safe-guard in case you use a variable.
check if the variable "has" changed, if it does, than refresh, else skip it in case
you want it a bit optimized 🙂

but for personal use, it probably doesn't matter that much though =)

its just a feedback/suggestion.
I wonder whether it helps to go back a few steps and not use custom code for now.

States allow you to add and seal skills and also skill types, it's right there in the database -> states -> properties. Your "fire attunement" state can give the player access to a couple of fire-based skills, or you can group them into a "fire" skill type. Your regular skills would still be visible, but greyed out, and I still think this would be the more intuitive way.

Last but not least, you can also look around or ask for a plugin to hide inaccessible skills rather than just greying them out.
I wonder whether it helps to go back a few steps and not use custom code for now.

States allow you to add and seal skills and also skill types, it's right there in the database -> states -> properties. Your "fire attunement" state can give the player access to a couple of fire-based skills, or you can group them into a "fire" skill type. Your regular skills would still be visible, but greyed out, and I still think this would be the more intuitive way.

Last but not least, you can also look around or ask for a plugin to hide inaccessible skills rather than just greying them out.
That could be a way to do it, but in my case I prefer to "modify" a skill rather than make more skills.

In fact, my setup already makes duplicate skills, just for a different modification, and it would be too bloated to my taste, lol. Let me explain if you wanna read:

My actor has these commands: Shoot, Configure (may change the name, idk), Wait, Items.
Shoot uses a skill (attacks with a gun). I can use a skill directly from a command with a plugin I already have set up. Each shot uses MP.

Configure is a skill type, so it opens a list of skills. Some of them can configure the gun so it becomes fire type, electric type, or ice type. And also, other skills make the gun able to shoot 2 or 3 times per use. Because this takes more MP, and I use the "repetition" parameter, I need to make this 3 separate skills, whose command I will show or hide with common events (the plugin I use for commands skills lets me do this easily).

I don't think I want to make 3 skills for normal, 3 for fire, 3 for ice and 3 for electric just to avoid this variable thing not refreshing that I already found a solution for :9 If anything, I got the variable idea in the first place because I wanted to avoid that. Either would have worked, though.

Original thread: https://forums.rpgmakerweb.com/threads/skill-description-that-always-refreshes.183473/