How to obtain a user's state resistance?

So I understand the following can be done to obtain a user's resistance to the death state:

Code:
var deathState = user.deathStateId();
if (user.stateRate(deathState) > 0.01 && !user.isStateResist(deathState)) {
  user.setHp(0);
  if (user.isDead()) {
    user.performCollapse();
  }
}

The above code is used to check if important enemies are resistant to the death state. What if I wanted to check a user's resistance to another state? Say it was ID 9. What would it be?

user. ???
I haven't learned any JavaScript yet, but it looks like you can just do this:
user.stateRate(9) User's percent resistance to state 9. Returns a value between 0.00 and 1.00
user.isStateResist(9) User is resistant to state 9. Returns true or false.
I haven't learned any JavaScript yet, but it looks like you can just do this:
user.stateRate(9) User's percent resistance to state 9. Returns a value between 0.00 and 1.00
user.isStateResist(9) User is resistant to state 9. Returns true or false.

That's right. Simply replace 'deathState' with the ID of the state you want to check.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-obtain-a-users-state-resistance.77978/