How to modify mouse movements, like acceleration, increasing pointer speed, and more on macOS

Hi Guys, I've been wanting to make a bettermouse-like tool for some time now, but I can't figure out how to modify mouse events to do it. I've managed to get mouse events, like the cursor moving, but I can't seem to modify them. What I try either creates a feedback loop, does absolutely nothing, or makes the cursor have a seizure. Any help is appreciated!

How to modify mouse movements, like acceleration, increasing pointer speed, and more on macOS
 
 
Q