I've done MIDI compression using a combination of velocity scale and offset.
Your compression ratio is simply the scaling. For 2:1, just scale by 50%. Then make-up gain is the velocity Gain you add back in.
You'll find the Scale Velocity command in the Process menu. Here I have it set for a 2:1
It will likely be too soft after that so dial in the Gain knob on the MIDI or Instrument track to taste (if using the inspector) or the Gain slider in the track strip.
For example if your input range was velocities 20 - 80 and you'd like to bring up the values that are too soft, a 50% scale gives you 10 - 40, so add 40 back in on gain to get 50 - 80.
If on the other hand your louds are too hot, like 60 - 127 and you want to keep the lows where they are, then 60 - 127 will scale to 30 - 63, so add 30 gain to get you to 60 - 93.
But you don't really have to worry about the numbers too much, just adjust the gain to taste.
<Update> Just saw your 2nd post where you want a dynamic adjustment based on distance from a threshold. For that you'd likely need an MFX. Or I suppose a cal script could be modified to accomplish something interesting.
Keith