how do i write an If (User.mp > 50) for conditional Branches?

I want to make a Skill that repeats itself till the MP of the User are Empty.

so my Idea was to put a conditional branch into the common event to
A: check if User Mp is > 50
B: then reduce MP by 50
C: use skill
Repeat A if User Mp is > 50 els finish.
1750449331860.png

I've set up everything nicely as a Custom Action and all but even after googling and searching alot... i can´t find how to write that part properly as i lack any programming knowledge T-T)7

thanks in advance :x
A couple of things you could try:
  1. $subject.mp > 50 (because this is in a VisuStella action sequence); or
  2. BattleManager._subject.mp > 50

[Edit: option 1 might actually be something like $user...not sure, but I think VisuStella does have something like that.]
Thanks, BattleManager._subject.mp > 50 worked perfectly Fine :>
that script code is needed due to the action sequence, but if you want to do this by pure eventing for other situations, you'll need two event commands.
first control variable to load the actor MP into a variable (available in the game data section of that command)
then a conditional branch checking the variable value

Just added as a FYI for those who didn't know or don't use VS action sequences
funny enough that i Just encountered that problem while playing around with my new knowledge xD
Anyway: I made an skill of off this that basicly combo extends for the cost of 50 Mp:

◆Plugin Command:VisuMZ_1_BattleCore, ACSET: Setup Action Set
: :Display Action = true
: :Immortal: On = true
: :Battle Step = true
: :Wait For Movement = true
: :Cast Animation = false
: :Wait For Animation = false
◆Plugin Command:VisuMZ_1_BattleCore, MECH: Damage Popup
: :Targets = ["all targets"]
◆Plugin Command:VisuMZ_1_BattleCore, MOVE: Jump
: :Targets = ["user"]
: :Desired Height = 200
: :Duration = 20
: :Wait For Jump? = false
◆Plugin Command:VisuMZ_1_BattleCore, MOVE: Move To Target(s)
: :Targets (Moving) = ["user"]
: :Targets (Destination) = ["current target"]
: :Target Location = front base
: :Melee Distance = 24
: :Offset Adjustment = horz
: :Offset: X = 0
: :Offset: Y = 0
: :Duration = 20
: :Face Destination? = true
: :Movement Easing = Linear
: :Movement Motion = walk
: :Wait For Movement? = true
◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
: :Targets = ["user"]
: :Motion Type = attack
: :Show Weapon? = true
◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
: :Targets = ["current target"]
◆Loop
◆Show Choices:Extend?, No (Window, Right, #1, #2)
:When Extend?
◆If:Script:BattleManager._subject.mp > 50
◆Plugin Command:VisuMZ_1_BattleCore, MECH: HP, MP, TP
: :Targets = ["user"]
: :HP =
: :HP Rate = +0.00
: :HP Flat = +0
: :MP =
: :MP Rate = +0.00
: :MP Flat = -50
: :TP =
: :TP Rate = +0.00
: :TP Flat = +0
: :Damage Popup? = true
◆Control Variables:#0012 Extend! = Random 1..5
◆If:Extend! = 1
◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
: :Targets = ["user"]
: :Motion Type = attack
: :Show Weapon? = true
◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
: :Targets = ["current target"]
◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
: :Targets = ["user"]
: :Motion Type = attack
: :Show Weapon? = true
◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
: :Targets = ["current target"]
◆
:End
◆If:Extend! = 2
◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
: :Targets = ["user"]
: :Motion Type = attack
: :Show Weapon? = true
◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
: :Targets = ["current target"]
◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
: :Targets = ["user"]
: :Motion Type = attack
: :Show Weapon? = true
◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
: :Targets = ["current target"]
◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
: :Targets = ["user"]
: :Motion Type = attack
: :Show Weapon? = true
◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
: :Targets = ["current target"]
◆
:End
◆If:Extend! = 3
◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
: :Targets = ["user"]
: :Motion Type = attack
: :Show Weapon? = true
◆Plugin Command:VisuMZ_1_BattleCore, ANIM: Show Animation
: :Targets = ["current target"]
: :Animation ID = 78
: :Mirror Animation = false
: :Wait For Animation? = false
◆Plugin Command:VisuMZ_1_BattleCore, MECH: Emulate Skill Effect
: :Skill ID = 117
: :User(s) = ["user"]
: :Targets = ["all targets"]
◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
: :Targets = ["current target"]
◆
:End
◆If:Extend! = 5
◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
: :Targets = ["user"]
: :Motion Type = attack
: :Show Weapon? = true
◆Plugin Command:VisuMZ_1_BattleCore, ANIM: Show Animation
: :Targets = ["current target"]
: :Animation ID = 67
: :Mirror Animation = false
: :Wait For Animation? = false
◆Plugin Command:VisuMZ_1_BattleCore, MECH: Emulate Skill Effect
: :Skill ID = 101
: :User(s) = ["user"]
: :Targets = ["current target"]
◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
: :Targets = ["current target"]
◆
:End
◆If:Extend! = 4
◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
: :Targets = ["user"]
: :Motion Type = attack
: :Show Weapon? = true
◆Plugin Command:VisuMZ_1_BattleCore, ANIM: Show Animation
: :Targets = ["current target"]
: :Animation ID = 72
: :Mirror Animation = false
: :Wait For Animation? = false
◆Plugin Command:VisuMZ_1_BattleCore, MECH: Emulate Skill Effect
: :Skill ID = 109
: :User(s) = ["user"]
: :Targets = ["current target"]
◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
: :Targets = ["current target"]
◆
:End
◆
:Else
◆Plugin Command:VisuMZ_1_BattleCore, ACSET: Finish Action
: :Immortal: Off = true
: :Wait For New Line = true
: :Wait For Effects = true
: :Clear Battle Log = true
: :Home Reset = true
: :Wait For Movement = true
◆Break Loop
◆
:End
◆
:When No
◆Plugin Command:VisuMZ_1_BattleCore, ACSET: Finish Action
: :Immortal: Off = true
: :Wait For New Line = true
: :Wait For Effects = true
: :Clear Battle Log = true
: :Home Reset = true
: :Wait For Movement = true
◆Break Loop
◆
:End
◆
:Repeat Above

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-write-an-if-user-mp-50-for-conditional-branches.178440/