How can i add range attacking to my behavior tree?

so this is what i came up with so far. I want the tree to first check if the character is out of melee ranged ( I called the boolean “IsInRangedRange”) so that way they can do a ranged attack first with a cooldown.

If they are in melee range, they will do the melee attack. (works perfectly fine)

The ranged attack isnt working correctly which is what im trying to figure out at the moment