[SOLVED] Addon for Theoallen's Always Accurate Attacks?

Ruby:
# Theoallen's individual attack accuracy

class Game_Battler
  alias tsbs_eva item_eva
  def item_eva(user, item)
    return 0 if item.note[/<always hit>/i]
    tsbs_eva(user, item)
  end
 
  alias tsbs_hit item_hit
  def item_hit(user, item)
    return 1 if item.note[/<always hit>/i]
    tsbs_hit(user, item)
  end
end

So I was wondering if there could be a scope/condition added onto this where "always hit" will apply until the user is afflicted with Blind or something similar. I tried applying "unless user.state?(3)" but it didn't seem to do anything.

Example of what I mean:

* Attacks tagged by this script are always accurate until you are affected by blind, which changes the hit rate from a perfect 1 and lowers the accuracy by 50%.
My first guess would be
Ruby:
# Theoallen's individual attack accuracy

class Game_Battler
  alias tsbs_eva item_eva
  def item_eva(user, item)
    return 0.5 if user.state?(3) && item.note[/<always hit>/i]
    return 0 if item.note[/<always hit>/i]
    tsbs_eva(user, item)
  end
 
  alias tsbs_hit item_hit
  def item_hit(user, item)
    return 0.5 if user.state?(3) && item.note[/<always hit>/i]
    return 1 if item.note[/<always hit>/i]
    tsbs_hit(user, item)
  end
end
My first guess would be
Ruby:
# Theoallen's individual attack accuracy

class Game_Battler
  alias tsbs_eva item_eva
  def item_eva(user, item)
    return 0.5 if user.state?(3) && item.note[/<always hit>/i]
    return 0 if item.note[/<always hit>/i]
    tsbs_eva(user, item)
  end
 
  alias tsbs_hit item_hit
  def item_hit(user, item)
    return 0.5 if user.state?(3) && item.note[/<always hit>/i]
    return 1 if item.note[/<always hit>/i]
    tsbs_hit(user, item)
  end
end

Tested it through many scenarios and it works exactly the way I wanted. Thanks. 😍

Original thread: https://forums.rpgmakerweb.com/threads/solved-addon-for-theoallens-always-accurate-attacks.148045/