As a note here, you must use McCoy on Mudd for a diagnosis. For some reason, the medical tricorder won't function here (or at least it didn't in my version of the game).
But before you concentrate on curing him, you need to get him to a bed.
The phasers won't work, so find someone who can overpower Mudd.
With a nerve pinch, perhaps?
Use Spock on Mudd.