Comparing two variable voltages with hysteresis
Easiest is to difference-amplify first, then the output
is ground-referenced and the familiar hysteresis circuit
just works.  Ground, here, is a 'constant reference'.

Like this:







simulate this circuit &ndash; Schematic created using CircuitLab

Slightly more tricky, one could use a series resistor and a switchable
high impedance current source (LM13700 can fill that function)
to put (in the form of current times resistor) a series voltage
offset onto the (+) comparator input, polarity determined
by the comparator output; that would change the
input signal slightly, though.