Mark targets if party leader

I am tanking about want to make my target a skull, I couldnt find any good macros so I made my own. I created the macro below that checks if the target is marked, if not it adds the skull so it will not spam the command.
/run GetRaidTargetIndex(“target”)~=8 then SetRaidTarget(“target”,8)end

BUT I would really like to only mark targets if I am the party/raid leader. Any help would be appreciated.
/run if IsPartyLeader() and GetRaidTargetIndex(“target”)~=8 then SetRaidTarget(“target”,8)end

I have keybound F5 to F12 as the different markers. Then I just hit F12 for the skull when I need it.

however you could try:

/run if UnitIsGroupLeader("player") and GetRaidTargetIndex("target")~=8 then SetRaidTarget("target",8) end

Thank you! How do you test if the target has 0/nil for a marker? (“target”)=0 does not work for me.

/run if UnitIsGroupLeader(“player”) and UnitExists("target") and GetRaidTargetIndex("target")~=8 then SetRaidTarget("target",8) end

0 = No Marker
1 = Yellow 4-point Star
2 = Orange Circle
3 = Purple Diamond
4 = Green Triangle
5 = White Crescent Moon
6 = Blue Square
7 = Red “X” Cross
8 = White Skull