Need help, the speed stacks if I press left/up, right/up, left/down or right/down.

I am trying to make that the ball deaccelerates when you don’t press the button, and it works, but if I press left/right with the combination of up/down the ball reaches high speed. I don’t know what to do.

And here’s the movement:

If someone could lead me to where the problem is and help me it would be amazing.

Finallly I fixed it making 2 more variables, similar to speed and MaxSpeed, but only for vertical movement. (SpeedV and MaxSpeedV)

I know this way of fixing is very troublematic, so if there is a way more simple and efficient please let me know.