This is more complicated then you think it is.
However, the easiest solution is to find the FFT of the signal and see the power content in each frequency band. I am guessing that cough would have high energy in the lower frequencies.
Now you can setup a threshold level and flag 1 if it is above the threshold. To be more accurate have your window size in time domain set to a small value.
Another important property of speech is that, it has harmonics. So try to Identify the fundamental frequency, compute the higher harmonics and use a look up table.