How to go about Source Engine inerta?

In the source engine, namely one of the source engine games Team Fortress 2, if you walk off of a higher elevation, regardless of if you let go of a movement key you will end up in the same spot. Another feature is that when a player is walking and stops holding a key, the player will slide for a few seconds before stopping.

I want to accomplish this either via a VectorForce or by any other means. I am considering get the player’s velocity times drag, however I cannot think of anything so far. What is a good way to go about this?

This may or may not be useful, but the source engine was originally based off the Quake 2 engine which is open-sourced on GitHub. I’m sure with a bit of patience you can find Quake 2’s movement code:

There is also this video which may help:

Although it’s likely that TF2 has modified its movement mechanics to some extent within the source engine’s codebase to suit the game, so you may have to just play around with the Quake 2 movement mechanics or something else until you get something that feels right.