MZ Insta-kill Skill, but the chance of success is determined by a state.

Hello!
I've been at this problem for the last four hours, so either it's way more complex than I originally assumed, or I am just completely overlooking something. Please keep in mind that I have bare minimum knowledge of scripts and how to use/write them, I've been trying to find sources to learn from, but everything I've found seems... advanced. Hence, I'm struggling haha.

So the problem I'm facing right now is this;

  • I have a Skill called Hama. The skill by itself has a 10% chance of inflicting instant-death on an enemy.
    (This works fine by using the Effects box and having Add State > Dead 10%.)
  • However, I have another Skill called Hama Boost. It's a skill that adds a passive state by the same name.
    (It uses VisuStella's Skill and States Core plugin with the <Passive State: x> applied to the notetag, which gives the user the Hama Boost state, if the user knows the Hama Boost skill.)
  • The Hama Boost State is intended to increase the likelihood of Hama being successful, it has the description of "Increases the success rate of instant death by Hama". So, the intention is to boost the success rate from 10% to something like 30%, for example.
  • But... I have no idea how to implement this in a working manner.
I think on the Hama skill, I need a conditional check; to check if the user has the Hama Boost State first, and then determine the success rate of inflicting Death on the target depending on whether the user has the state or not?
I've tried this on a common event, using the script below:

if (user.isStateAffected(88)) {
if (Math.random() < 0.3) {
target.addState(1);}
} else {
if (Math.random() < 0.1) {
target.addState(1)}}

But... it doesn't do anything whatsoever. I don't even know if that's correct, because as I said, I have no knowledge on how to do stuff like this.

How can I implement something like this?





EDIT: Apparently I'm an idiot running on very little sleep... I solved this myself by using the State Rate in the State Traits section. I can't believe I forgot about that 😔

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/insta-kill-skill-but-the-chance-of-success-is-determined-by-a-state.150756/