Maybe you were looking for...

I'm trying to change the mob's weapon if the player is near but it wont change

Everything seems fine as far as the command goes but the weapon of the enemy won't change. execute at @e[type=minecraft:skeleton,name="Soldier"] if entity @a[d