The words thyme and dysthymia are not related  it seems According to Merriam-Webster’s New Collegiate Dictionary  the former is from the Greek thymon  which refers to fumigation  I assume because the herb was burned  and the latter is from the Greek thymos  which  according to Wikipedia  “is a Greek word expressing the concept of ‘spiritedness’ (as in ‘spirited stallion’ or ‘spirited debate’)