My resource for food shelf life is usually stilltasty.com . However, I can't find hot chocolate on the list. I'm talking about a small pot of hot chocolate - milk, cocoa, sugar, water. Is the guideline the expiration date of the milk? Or will it last longer/shorter?
It is a common misconception that the shelf life of a cooked food (= mix of ingredients) is the same as the shelf life of the shortest-lived ingredient. I cannot stress enough how wrong this assumption is.
As with any cooked food, the shelf life of hot chocolate should be about 3 to 5 days in the fridge, with a cumulative stay in the danger zone of no longer than 2 hours.
An explanation of why the assumption is wrong: Food spoils when bacteria (or sometimes other organisms like mold) create a colony in it. For this to happen, the food has to offer all the conditions an organism needs for survival. Most cooked foods are nutritious enough to ensure the survival of simple organisms.
There are single ingredients which hold for longer. Bar chocolate is a good example. The reason for that is that they are not a complete medium. Chocolate does not have enough moisture for bacteria to grow in it. But as soon as you mix any ingredient with something else, you cannot know if the other ingredients have not added the factor the bacteria have been missing. So, if you mix for example water (practically indefinite shelf life because it has no calories) and flour (practically indefinite shelf life because it has no moisture), you get dough, which will have large bacterial colonies within 3 days.
Exceptions in the other direction (food that spoils sooner than 3 days) are foods which decompose on their own. For example fish - it goes bad quickly even at fridge temperature, but the reason is the fish's own enzymes, not bacteria. That's why it is normally held on ice, if not frozen outright.
As a side note, you cannot rely on the expiration date of milk anyway. It is OK for traditionally pasteurized milk. But the expiration date of ESL and UHT milk is only valid as long as the packaging has not been broken. Once you open it, it is again good for about 5 days.
Conclusion: For anything cooked, up to 5 days in the fridge is a good assumption. Make it less for food which is known for high risk of contamination (e.g. food containing raw eggs), but never longer, even if the expiration date of the ingredients is longer than that.
You can still use the prepared food rule (~4 days in fridge, 2hrs at room temp). You can go with expiry of the most perishable IF the other ingredients don't have a spoiling effect on it (in this case, the effect is not significant). So the question somewhat reduces