Counter attacks.

Right now i'm using victors animated battlers and basic module and actors.

I'm trying to get my characters to take the damage as normal, then decide to counter attack.

Also when a creature hits twice, i want it to counter twice, currently it only counters once.

I KNOW VICTOR has a script on this currently but i'm trying to avoid using another one of his scripts as i'd like to script this myself, i just don't know where to find where it calls for counters nor what to put into the counter area to do the damage.

Also i tried getting victors script but it tried to install a download manager that tried to install a crap ton of bloat ware. so if anyone knows where to get victors script so i have it just in case without bloat ware that'd be awesome
You might want to check these methods under Scene_Battle:

Code:
  #--------------------------------------------------------------------------  # * Invoke Skill/Item  #--------------------------------------------------------------------------  def invoke_item(target, item)    if rand < target.item_cnt(@subject, item)      invoke_counter_attack(target, item)    elsif rand < target.item_mrf(@subject, item)      invoke_magic_reflection(target, item)    else      apply_item_effects(apply_substitute(target, item), item)    end    @subject.last_target_index = target.index  end
Code:
  #--------------------------------------------------------------------------  # * Invoke Counterattack  #--------------------------------------------------------------------------  def invoke_counter_attack(target, item)    @log_window.display_counter(target, item)    attack_skill = $data_skills[target.attack_skill_id]    @subject.item_apply(target, attack_skill)    refresh_status    @log_window.display_action_results(@subject, attack_skill)  end

Original thread: https://forums.rpgmakerweb.com/threads/counter-attacks.39586/