It's way easier than it sounds. Logitech provides a tool that lets you program their gaming mouses. They use Lua. I don't know Lua but there were plenty of guides for different gaming macros like recoil compensation and the Logitech documentation was decent enough.