MZ Error message I don't understand

To be honest, there are a lot of error messages I don't understand, but this one is the one bothering me at the moment.

1681494270587.png


I am testing out a boss battle which works fine, but I have a Continue/Retry mechanic for such battles. I have used this on an earlier boss battle, so I know that the switches for the HP etc. and items are set up correctly. In testing the Retry it began the battle transition but then crashed with this error.

Can anyone give any pointers as to what might be going on?
Thanks.
As you can see, it's really hard to troubleshoot with VisuStella stuff since the plugins are obfuscated and we can't actually see what any of the function names are.

And there are a variety of places clamp might be used.

Ultimately, "of undefined" tells you there's something you're telling the game is there which isn't actually there. An enemy in the troop that was deleted? Trying to refer to something in a script call that was removed?
"Clamp" is a function that is invoked on numbers, e.g., 700.clamp(800, 900) returns 800. In other words, the 800 and 900 define a min-max-range.

According to your stacktrace, the line that is failing is

Code:
Game_BattlerBase.prototype.refresh = function() {
    for (const stateId of this.stateResistSet()) {
        this.eraseState(stateId);
    }
    this._hp = this._hp.clamp(0, this.mhp);
    this._mp = this._mp.clamp(0, this.mmp); <-- this line!!
    this._tp = this._tp.clamp(0, this.maxTp());
};
which is in the core code, not VS (That does not mean that VS automatically would be the source of problems here).

Some plugin or mechanic seems to erase the MP value from your actor. Maybe that helps.
@ATT_Turan and @Aerosys
I'm working my way through this whole thing and haven't found the fault yet. I think I shall have to replay to get back to the first time I used this feature and see if I can spot the difference.
Thanks for the help. I'll report back tomorrow if I find anything.
As an edit wouldn't show up...
@ATT_Turan and @Aerosys
I found it. A silly mistake on my part (again). In changing things around for a different battle I messed up my common event which does all the recording of HP, MP and items, so of course when the c.e. tried to call those values at the end of battle it couldn't find them.
I'm sorry to have troubled you.

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/error-message-i-dont-understand.156670/