That's still pretty wrong, honestly it's just as bad as OP. No loops (or even better, simple recursion), the coffeeEmpty var is only set once, etc. >>7793133
is more correct but I still don't like it.
I made pic related; you could just recall sipCoffee(8) within the if() instead of defining a new function, but for clarity you'd want an analogous function that's properly named so you know what's going on. Still not perfect, but better. Maybe the other ones are better looking from a design stand-point though, so "proper" code may not actually be required for these types of images.