millis() resets every time I open the Serial Monitor

Have a look here:
https://forum.arduino.cc/index.php?topic=525237.msg3583376#msg3583376
I've found a 0.1 uF ceramic cap works fine with Nanos, never tried on a UNO or Mega.