The X Factor judge admitted his diagnosis massively impacted his mental health