damage @s 0 mob_attack by @n[type=villager,tag=engineer_q]

execute if entity @s[tag=!engineer_q_hit,tag=upgrade_5_target] run function main:mechanics/damage/enemy/deal_damage with storage minecraft:q_damage engineer.upgrade_5
execute as @s[tag=!engineer_q_hit] at @s run function main:mechanics/damage/enemy/deal_damage with storage minecraft:q_damage engineer.id1
tag @s add engineer_q_hit