How do I set different MaxWalkSpeed for different directions?

I’m making a game where the player can accelerate to increase their running speed, similar to how a car’s speed can increase in a racing game. However, I only want this running speed increase to affect forwards running speed; sideways and backwards speeds should be constant. Is there any way to achieve this? I tried scaling the AddMovementInput WorldDirection vector and changing the ScaleValue parameter, but that also affected the sideways and backwards accelerations. (It kept the time to reach the top speed constant, but I want the rate at which speed increases to be constant.) Also, it involved dividing the character’s current speed by a variable, which I’d rather avoid for such a simple function. Would a custom movement mode work? It seems like it would be well suited for this kind of task, but I’m also clueless on how to implement custom movement modes. (I’m using C++.)