set player y speed to 0

TL:DR Set player y velocity to 0 So I am making my own Attack On Titan ODM gear datapack, and I want to make the players y speed be 0, so basically halting your movement. I tried by using levitation, and the gravity attribute, but the problem is minecraft velocity is all based on additive velocity, not actually letting me set a velocity to a specified value. I settled for making the player ride something and immediately stop riding it, and it works, but I dont want horizontal velocity to be halted as well.
Continue to help post