Nothing about your
triggers will affect the Melee/Ranged status of a unit. All you're doing is Adding/Removing some unrelated abilities.
You can determine whether a unit is Melee or Ranged in the Object Editor by changing it's Combat settings:
View attachment 516841
For example, Demon Hunter is melee, but after using Metamorphosis he transforms into an entirely new unit that uses a Ranged attack. You could do this with your Hero as well.
Also, assuming you're on 1.31+, you can try to modify the Weapon using this Action but I recall it being buggy or at least needing extra steps:
-
Actions
-

Unit - Set Unit: (Triggering unit)'s Weapon Boolean Field: Attacks Enabled ('uaen')at Index:0 to Value: False
-

Unit - Set Unit: (Triggering unit)'s Weapon Boolean Field: Attacks Enabled ('uaen')at Index:1 to Value: True