'It appears the incident likely took place while the defendant was experiencing a manic episode which was the first episode in his life,' Makofsky said according to the Daily News.
McClean must now comply with treatment, give authorities monthly updates and appear for at least one more court date before his charges are completely dismissed.
He is unlikely to suffer from a comparable manic episode again, his attorney Daniel Ollen said.
McClean, who also studies at Columbia University, posted a photo of himself on Instagram on Friday, with the caption: 'out of court and back in the classroom'.
He wrote in another post that he has been diagnosed with a genetic predisposition to manic episodes.
'My behavior in Times Square on June 30 was a culmination of an unaware seven days of mania which distorted reality,' he wrote.
'I respect the court's desire to understand what triggered my actions, and wish to thank the NYPD officers for their patience in handling the situation.
'I will continue working with my doctor to maintain a balanced well-being: becoming self-aware has been progress in itself.'
McClean has a future court date on November 4 for an update on his status.