Making a skill hit more times depending on the number of status effects

Hello,i want to make a skill that has scaling based off the number of aliments/status effect a enemy has
ex:hits once if no aliment,gets +1 hit if the enemy has poison
caps at 6 hits
does anyone have any idea how to do this?
Use note tag <multi state hit> on skill

Ruby:
#                      Multi Hits by states inflicted
#                             (version 1.0)
#                             by Roninator2
#                             from The_Sarah

module TheSarahMultiHits
  class << self
    attr_accessor   :state_item_repeats
    attr_accessor   :was_game_enemy
  end
end

class Game_Battler < Game_BattlerBase
  alias thesarah_multihits_gamebattler_makedamageval    make_damage_value
  def make_damage_value(user, item)
    thesarah_multihits_gamebattler_makedamageval(user, item)
    if TheSarahMultiHits::was_game_enemy == true
      item.repeats = TheSarahMultiHits::state_item_repeats
      TheSarahMultiHits::was_game_enemy = false
    end
  end
end

class Game_Actor < Game_Battler
  alias thesarah_multihits_gameactor_use_item        use_item
  def use_item(item)
    enemy = $game_troop.alive_members[self.actions[0].target_index]
    if enemy.is_a?(Game_Enemy) && item.is_a?(RPG::Skill) &&
        item.note[/<multi state hit>/i]
      TheSarahMultiHits::state_item_repeats = item.repeats
      TheSarahMultiHits::was_game_enemy = true
      enemy.states.each do |st|
        item.repeats += 1 if item.repeats < 6
      end
    end
    thesarah_multihits_gameactor_use_item(item)
  end
end

Original thread: https://forums.rpgmakerweb.com/threads/making-a-skill-hit-more-times-depending-on-the-number-of-status-effects.169006/