You should be able to accomplish it using JavaScript in MIDI Remote utilizing a “customValueVariable”.
I would strongly recommend using an encoder sending relative MIDI CC as opposed to a potentiometer.
For inspiration, I wrote a simple script to use an encoder for the Jog left/right functions.
With a little bit of tweaking you should be able to alter it to your needs.