Robin Williams killed himself because of dementia.
I am sure 20+ years of cocaine intake had nothing to do with his eventual mental state.