Just going to say upfront that I was testing this in a solo custom game and have not been using macros in my games.
I have seen a lot of conflicting information regarding how to pull off the rocket jump, whether you should jump and then rocket, rocket and then jump, or do both at the same time. The answer is unequivocally rocket and then jump, but the timing is somewhat specific (if you want access to all reasonably achievable rocket jump spots).

I tested using a variety of the hardest and most inconsistent RJ spots in the game and in several deferent servers to see if ping played any role in the timing. What I found was that the range in which these hard jump spots were achievable was between 24 and 52 ms of the actuation of the rocket and the jump inputs, and the absolute optimal height fell in line with the mean of the range at 38ms. As stated previously I tested using multiple servers/pings, regardless of the ping, be that 25, 120, or 250, the range of the optimal RJ remained the same. Another thing of note, for jumps requiring you to cover a horizontal distance greater than what a regular RJ, the best time to begin the sprint is right before you reach the apex of your vertical movement.

So how do you cheese it? My method is to add additional key bindings for your rocket and jump to the 1 and 3 keys (may differ depending on keyboard layout). What I do is, while holding W with my middle finger, rest my ring finger on the 1 key, and lightly touch the 3 key with my index finger with my index finger. Then simply press down on both. For me, the difference in initial pressure lead to around a 30-40ms actuation difference nearly every single time. I also recommend loading up whatever keyboard software that you use and use the “record macro” function to test/ practice the timing and pressure (any difference in actuations that fall between 25 and 50ms is suitable for every jump that can reasonably be done).

In general I found that using right mouse click and spacebar to perform the jump to be the least effective way to perform the jump reliably, You have to perfectly time a mouse switch with the spacebar coordinating two separate hands, using a left thumb and right digit. Using two keys that are the same size, same switch, and with the same hand is infinitely easier. I did try rolling the keys but was averaging a 60ms deference, I do use heavy Gateron ink black switches so you may have more luck with that method.