Checking If An Enemy Has A Debuff?

What I want to do is check through a conditional branch if an enemy has a debuff (not a state, a debuff).

I couldn't find a way to do this with event commands or script calls from my cursory search. So I figured I'd ask here about it.
I think this would work:

JavaScript:
$gameTroop.members()[2].paramPlus(2) < 0

"Does the 3rd enemy (enemy index 2) have a debuff to attack (parameter 2)?"
Solved the problem myself. The conditional branch script call is
"$game_troop.members()[0].param(2) < 4"
"Does the 1st enemy (enemy index 0) have an Attack lower than 4."

Sadly, "< 0" checks if the attack is below 0. Which means I have to get the enemy's base Attack value each time I wanna check if it's been debuffed.

Anyone looking for this info later: param(2) means "attack," and you can find the other parameters in the "Game_BattlerBase" part of the Script Editor.

I wouldn't have been able to find this without Solar though, so thank you for your help!
Don't use () parentheses after members. Ruby doesn't need them there.
Ah, whoops, I missed that this was in the VXAce forum. Sorry for the confusing answer! But as you figured out yourself, it does still work if you properly convert it to Ruby.

But you likely still want paramPlus and not param – as you said, param(2) returns the attack value, not the attack buff (and thus is no different from just writing atk); whereas paramPlus(2) returns the amount that your attack has been buffed (in the range [-2,2], I believe). This is just a guess as I haven't opened up VXAce, but maybe it's called param_plus? Try this:

Ruby:
$game_troop.members()[0].param_plus(2) < 0

Don't use () parentheses after members. Ruby doesn't need them there.
I may not be a Ruby expert, but… does it not work both with and without the parentheses? But that said, if it does work without them, even if it still works with them, I'd recommend omitting them:

Ruby:
$game_troop.members[0].param_plus(2) < 0
param_plus is used to determine the extra value added by the "grow" command.

Code:
#--------------------------------------------------------------------------
# * [Raise Parameter] Effect
#--------------------------------------------------------------------------
  def item_effect_grow(user, item, effect)
    add_param(effect.data_id, effect.value1.to_i)
    @result.success = true
  end

Code:
#--------------------------------------------------------------------------
# * Increase Parameter
#--------------------------------------------------------------------------
def add_param(param_id, value)
  @param_plus[param_id] += value
  refresh
end

Buffs can be accessed by the "param_buff_rate" method.

In the default engine "param_buff_rate" will return 1.25 with one level of buff, 1.5 with two levels of buffs, 0.75 with one level of debuff and 0.5 with two levels of debuff.

Code:
#--------------------------------------------------------------------------
  # * Get Rate of Change Due to Parameter Buff/Debuff
  #--------------------------------------------------------------------------
  def param_buff_rate(param_id)
    @buffs[param_id] * 0.25 + 1.0
  end

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/checking-if-an-enemy-has-a-debuff.180872/