Old English modignes "pride, passion, anger;" see moody + -ness. Meaning "condition of being moody" is from 1858.
Old English modig "brave, proud, high-spirited, impetuous, arrogant," from Proto-Germanic *modago- (cf. Old Saxon modag, Dutch moedig, German mutig, Old Norse moðugr); see mood (1) + -y (2). Meaning "subject to gloomy spells" is first recorded 1590s (via a Middle English sense of "angry").