Here’s a recent, relatively brief but interesting and thorough article on the Medicinal and Ritualistic Uses of Chocolate in Mesoamerica.
For a more in-depth read on the subject, I’ll recommend this book: Chocolate in Mesoamerica: A cultural history of Cacao