How do I remove the dodging for counterattacks? VXACE

I am trying to make a skill that does some damage then adds a counter attack effect that only triggers upon getting hit. I've been searching through the old threads and found the lunatic states script but after that my brain just started to get tired. Could someone help me on how to remove the auto dodging on counterattack.

I forgot to mention that the skill should also have a damage reduction effect aswell.
I found this script that allows you to choose how counter-attack works between 3 options :

Evade and Counter: Default mechanism. Probably no-needed. Add only for priority.
Hamedo: Character Deals damage before taking damage.
Counter Attack: Both deals damage.

Spoiler: Script
# 1224Deko - Hamedo miniscript v1.00
#
# This script overrides Scene_Battle and def invoke_item in it.
# No credits needed.
# Inspired from this thread:
# http://www.rpgmakervxace.net/topic/16995-taking-damage-when-counterattacking/
# So it would be nice if you credit xShinryu and P Bevans.
#
# Setup:
# Each State must have Ex. Param. CNT +100% in Features to Working.
# Exchange ID States in module Hamedo to your owns.
#
# Add 3 ways of counter-attack mechanism
#
# Evade and Counter: Default mechanism. Probably no-needed. Add only for priority.
# Hamedo: Character Deals damage before taking damage.
# Counter Attack: Both deals damage.
#
# If you use only another ID state with CNT ratio, will be working like default mechanism.


$imported = {} if $imported.nil?
$imported["HamedoState"] = true


module Hamedo

# Setup Evade and Counter state ID
EAC = 74

# Setup Hamedo state ID
HAMEDO_STATE = 75

# Setup Counter Attack State ID - Damage taken before Countering
CNT_ATK = 18

end

class Scene_Battle < Scene_Base
def invoke_item(target, item)
# Evade and Counter damage
if rand < target.item_cnt(@subject, item) && target.state?(Hamedo::EAC)
# apply_item_effects(apply_substitute(target, item), item)
if target.hp > 0
invoke_counter_attack(target, item)
end
# Hamedo Status
elsif rand < target.item_cnt(@subject, item) && target.state?(Hamedo::HAMEDO_STATE)
# apply_item_effects(apply_substitute(target, item), item)
if target.hp > 0
invoke_counter_attack(target, item)
end
if subject.hp > 0
apply_item_effects(apply_substitute(target, item), item)
end
# Counter Attack section
elsif rand < target.item_cnt(@subject, item) && target.state?(Hamedo::CNT_ATK)
apply_item_effects(apply_substitute(target, item), item)
if target.hp > 0
invoke_counter_attack(target, item)
end
# Original Counter-Attack Mechanism
# Original invoke_item
elsif 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
end
Use the following part of the code to link each of the three options to a different State ID that matches your needs.

Spoiler: Code Portion
module Hamedo

# Setup Evade and Counter state ID
EAC = 74

# Setup Hamedo state ID
HAMEDO_STATE = 75

# Setup Counter Attack State ID - Damage taken before Countering
CNT_ATK = 18

If you want a damage reduction when your character is under the Counter-Attack state, just use the Caracteristics pannel on the right side of the states database and increaes the Defense.

Spoiler: Screenshot
Capture.PNG

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-remove-the-dodging-for-counterattacks-vxace.176489/