AnalogWrite not working in If Statement

That's interesting (and unlikely) - what proof do you have?