noun, in medieval physiology : a fluid or juice of an animal or plant specifically : one of the four fluids entering into the constitution of the body and determining by their relative proportions a person's health and temperament
That's right: before humor was funny, a humor was something that could be described as a fluid or juice of an animal or plant. It was the Middle Ages, after all, and things could be downright medieval sometimes.
It all got started long before medieval times though. While it was still the established thinking in the European Middle Ages, the physiological theory of the humors dates to ancient Greece, with the four cardinal humors being blood, phlegm, choler (aka yellow bile), and melancholy (aka black bile). The particular mixture of the four humors in a particular individual was thought to determine that person's temperament as well as their mental and physical qualities. Ideally, you wanted to have a perfectly proportioned mixture of the four humors; if you didn't, you'd skew toward being too much one way or not enough another. (More on that below).
The word humor traces back to Latin humor or umor, meaning "moisture," which gets us pretty easily to the "fluid" meaning of the English word, but how did we get to the funny-related meanings of humor? Well, the physiological use referring to the four cardinal humors eased into a use of humor to mean "temperament, disposition," which led to "mood," which got us to "whim, fancy," and eventually to a plural use referring to actions that reveal the oddities or quirks of human temperament—such humors being especially suited for comedic theatrical presentation. The audience saw the humors of a character and they were whimsical, eccentric, and often funny. Soon after, the sense referring to the ability to be funny or to be amused by things that are funny developed.