The mobs gonna have slowness 8. If a player is in like 15 block-range from the mobs, the mobs will lose the slowness 8 effect.
execute as @a at @s run effect give @e[type=zombie, distance=15..] minecraft:slowness 1 8
execute as @a at @s run effect clear @e[type=zombie, distance=..15] minecraft:slowness
Uhhh... here's some random text!