Measuring the minimum voltage square wave
You have two options:

1) Use a peak detector


(Image from http://www.learningaboutelectronics.com/Articles/Peak-detector-circuit.php)

A peak detector would give you a voltage which is related to the most positive value of your square wave (or, in your case, the most negative if you flip the diode around).  You would then have a mostly-DC value which you can use for your comparator.

The downside is that it takes some time for the peak detector to discharge (in fact, you would typically need a discharging resistor which isn't shown in this diagram).  So it wouldn't necessarily respond correctly on a cycle-by-cycle basis.

2) Use an ADC

You can use an inverting amplifier to flip the range into something that you can sample with an ADC (I don't know what uC you're using, but almost all of them have built in ADCs).  You can typically sample much faster than 1kHz, which means you could get the "right" answer on a cycle by cycle basis by simply discarding samples during the "positive" cycle of the wave.

Note you'll need to design the inverting amp circuit such that it doesn't go outside your ADC range (for example, if your ADC can't handle negative voltage).  I won't go into detail on that, but ask if you have concerns.