A millis() problem within a function, within another function. (functception)

My post was too long so I removed the ac cycle in the code along with some button code for the second thermostat. There may be some extra brackets or the like.

Thanks