Overriding The Max Walk Speed Variable

I am trying to create a custom directional gravity function in 2d so I needed to make a custom gravity function for the x axis it worked for the z axis but when I tried it I needed to set max walk speed to 0 but it wouldn’t work when I tried it do you guys know a way to affect the x value of the character without the max walk speed in the character movement component getting in the way?