Over the years I've heard and seen people who were smoking on shabbos, but I noticed they were clearly having a mental breakdown. I would say maybe even outwardly displaying suicidal emotions.
Are they culpable for going to measures of self medicating. Is this pikuach nefesh.
Does a person have to have daas to transgress shabbos? There's clearly no daas here. So I guess it wouldn't apply.