Problem with focus macro

So this is my focus/target macro:

/focus [@target,exists,@mouseover]
/target [@target,noexists]mouseover;[@target,exists,dead]mouseover
/cleartarget [@focus,noexists,mod:shift]
/clearfocus [@target,exists,mod:shift]

I want it to do this:
Set a target for me on mouseover, if I have a target I want it to set a focus for me on mouseover. And if I have a dead target I want it to set mouseover as target without setting my focus (not sure if it is possible, to drunk to think atm). and when holding shift I want it to clear my focus and then if I do not have a focus I want it to clear my target.

The problem (super minor issue tbh) is with my “/focus” line and “/target” line. If I do not have a target it sets my mouseover as both target and focus and not just target (haven’t seen how it is if I got a dead target yet). I just think it is strange that I get the “/clearfocus” line and “cleartarget” line to work but not the “/focus” and “/target” line to work. Because it is basically the same principle except that one checks for target and the other for focus?

this is the macro Im using…

/focus [@target,exists,@mouseover]
/target [@target,noexists]mouseover;[@target,exists,dead]mouseover
/clearfocus [@target,noexists,mod:shift]
/cleartarget [@focus,exists,mod:shift]

sorry

this works me thinks:

/focus [nomod,target,exists]mouseover
/target [,nomod,target,noexists]mouseover;[nomod,target,exists,dead]mouseover
/cleartarget [@focus,noexists,mod:shift]
/clearfocus [@target,exists,mod:shift]

Final macro lol

/focus [nomod,target,exists,nodead]mouseover
/target [,nomod,target,noexists]mouseover;[nomod,target,exists,dead]mouseover
/cleartarget [@focus,noexists,mod:shift]
/clearfocus [@target,exists,mod:shift]

Final cleaned up macro:

/focus [nomod,exists,nodead]mouseover
/target [,nomod,noexists]mouseover;[nomod,exists,dead]mouseover
/cleartarget [@focus,noexists,mod:shift]
/clearfocus [@target,exists,mod:shift]