I'm gonna assume this is single targeting. Depending on how broad you want this to be, it would get a little bit more complicated but not much, you just need a dummy unit ability with X levels, a dummy unit, 2 point variables, and a timer.
On cast, setup the points, create a dummy unit, give that unit the dummy slow, which will start on its own at level 1, add an expiration timer to the dummy unit so you don't have to worry about cleaning it up after, and then have the unit cast on the target, and start the timer to finish in 0 seconds. In another trigger in which said timer expires remove the points, set them up again, check and see the distance of the 2 units, and then set create the dummy unit all over again, add the expiration timer on that unit so it dies on it's own, then add the dummy slow, and set the level to (distance between points / (distance amount you want[in your case, you said 500])) and then have the unit cast on the enemy, then finish with checking if the effect should still be working, if so, run the timer for a duration of V seconds (small interval (0.01 seconds+ depending on how often you want this to fire).
If that makes no sense, I'll tell you what it will do. When your hero/unit casts on 1 unit, it will slow them X%, and then constantly slow them Y%, checking their distance from the caster and slowing them Z% more for every V distance away. I think that's what you wanted?
If you want something else, then you'll have to be more specific.