Conditional Branch for MP Regen is dysfunctional. Please help!

I have this common event running as a parallel process.

Spoiler: Common Event
Screenshot (105).png

The common event is a very simple, three-step process:

Step 1: Define the variable "Joy" as the player's MP.
Step 2: If "Joy" is greater than 0, heal the player's MP by 1 every 120 frames; otherwise move on to Step 3.
Step 3: If "Joy" is equal to 0, damage the player's HP by 1 every 60 frames.

The conditional branch in Step 2 seemingly ignores the variable it is meant to check and heals the player's MP every 120 frames regardless of whether "Joy" is equal to 0. At absolutely no point in this common event does it say to keep healing MP even when "Joy" is equal to zero. This is the first and only common event I currently have in this project, and already it has become painstakingly inviting of my singular derision.

I am so infuriated with this, I am just about ready to explode in a fiery fit of rage and break everything around me. I need help!
You may have other MP regeneration items, which will kick in every so many steps. However, to test your event, add a text box in each of the conditions, which say:

This is the first case: \V[2]

For the else, have the test box say:

This is the 2nd case: \V[2].

This will tell it to output the value of the variable, and you will know which loop is being run.

Also you should really name the actor, as it is saying [].mp, so you might be getting garbage input. And you also have an extra set variable command in the last loop which is redundant, and would mess up error checking too.

One last thing: Check all scripts. Some use variable 2 for the coding. If that happens you will get unpredictable results. You may need to change to variable 22, as 1 - 20 get used by many scripts if you don't remember to configure them first.
I have no items, armours, weapons, or parameters which cause MP regeneration. I conducted two tests. In both tests, the actor's name was aptly changed to "Yellow Dot".

The first test was done with the variable identification number unchanged.
Spoiler: Common Event for First Test
Screenshot (106).png

The result of the first test indicated the first case was triggering every 120 frames, with "Joy" equal to the player's MP. Aside from the text, there was no change.

The second test was done with the variable identification number changed to 22.
Spoiler: Common Event for Second Test
Screenshot (107).png

The result of the second test indicated the first case was triggering every 120 frames, but "Joy" was shown to be 0 regardless of the player's MP.

Edit: I just noticed that I made an error in the second test. I forgot to change the variables within the text. Upon fixing this, the result of the second test is the same as the result of the first test.
I don't think your event's logic is solid. You are continually setting Joy to MP, then if Joy is greater than 0, you increase MP. Therefore, if Joy is ever greater than 0, it will continue to grow to infinity unless you specifically do something to set it all the way back to zero.

A good way to debug this is to set a "test" variable equal to the Joy, and directly set another "test" variable equal to the player's MP, and then print them both out in a message box (example: "Joy is \V[28] and Player's MP is \V[29] ") after every instance where you change either MP or the original Joy variable.

The one other thing that could be screwing you up is if you are referencing the wrong actor's MP. I see "[]'s MP" in your event and, without any other info, I become suspicious that you might be referencing an actor that doesn't exist or an actor you don't mean to.
Please name all your actors (and other database items), NEVER let them without a name like you did with your main actor.
Even if the player is to name that actor, it needs to have a default name.

After that, check your common event again if you selected the correct actor for the control variables.
Because if you have several unnamed actors, you'll never know whose MP you have read - that name is supposed to be inside the brackets.
The conditional branch in Step 2 seemingly ignores the variable it is meant to check and heals the player's MP every 120 frames
Of course, it's because you put 120 frames wait inside IF statement.
I only have one actor in this project, so there is absolutely zero chance that I am referencing a nonexistent or incorrect actor. Also, the MP healing targets the entire party anyway.

Edit: TheoAllen's suggestion solved the issue immediately. You are a hero!
Also if you use \V code, the [] in there is the # of the variable. So if you change the variable to 22, you need to change the call to \V[22] also. Something you'll want to keep track of for future debugging.
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/conditional-branch-for-mp-regen-is-dysfunctional-please-help.115325/