How to make a 50/50 ability.

In the game that I am trying to make, I am attempting to make it so that one of the characters has a starting move called "exuberant strike", which has a fifty percent chance to do two times the amount of damage that a regular strike would, but also has a fifty percent chance to stun the user.

I think it would be an interesting ability, but I have no idea how to make this in RMMV. If any of you have an idea on how to do this, I would be extremely grateful if you informed me.

Thank you for your time! 🙂
'Game Mechanics Design' is for looking at aspects of game play at a more conceptual level. "How do I...?" (implementation) questions go in the Support forum for the engine you are using.
Moved to: RPGMaker MV
'Game Mechanics Design' is for looking at aspects of game play at a more conceptual level. "How do I...?" (implementation) questions go in the Support forum for the engine you are using.
Moved to: RPGMaker MV

Thank you. Im new here, and I had no idea where to place this question. Again, thanks.
I’m not sure. You would have to create a state that has the stun and then the formula would look something like

If (Math.random() > 0.5) {formula} else {b.addState(stateId); formula*2}
Alright, got it. Thanks 🙂
Now, do I just leave it as Math.random, or do I put something in there, because I am assuming it is just Math.random
The only things you need to change here are the parts in bold

If (Math.random() > 0.5) {formula} else {b.addState(stateId); formula*2}

You can change the 0.5 to be any percentage you want. 0.5 being 50%. Note that the higher the percentage the less chance of double damage and stun. [Ex. 0.1, 10%, means that 10% of the time you will deal normal damage, and 90% of the time you will stun and do double damage].

The 2 at the end can be changed to whatever multiplier you want to use. 2 being double. 3 would be triple. 1.5 can be used. Any multiplier you like.
Got it, thank you.
You are a saint. 🙂
Not sure if anyone's going to reply to this, but how would I set this up in the database? I haven't had any luck so far.
@xem I approved your post and I'll leave this topic open since you seem a bit unsure of how to use the answers given to set up your database; however, we do frown on bumping support threads (help questions or "how do I"-type questions) that have been inactive for over a month (and this has been inactive for 3 years!). In the future, please just create a new topic (and link back to this old one if you need to reference it) - that helps avoid a lot of forum confusion. Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-50-50-ability.87203/