C.A.
I keep children in my home and I also have three children that are my own and two step children.
At this age they are becoming attached to items and I think from you letter her choice is a cup. Have you tried replacing it with a stuffed animal or another item? When she cries instead of a cup hand her a stuffed animal...one that maybe she can also sleep with. Just start with telling her that you don't have a cup but you have this...and alittle later give her a cup.. don't just take her cup from her. Until she no longer ask for it as a source of comfort.
Keep in mind that the greatest source of comfort for a child is knowing that their parents are always there. I don't think that letting a child cry at this age not knowing if you are there or not is a great idea maybe just opening the door laying her down and walking out without talking to her will help. That way she knows you are there and you have not given her the attention that she wants. No cup and No hugs! Just her stuffed animal or other item and you laying her down....a hundred times:)
She should be able to sleep through the night without any food or drinks but if she has received this for two years you might have to slowly wing her from it.
The last thing you want is for you child to feel that to eat or drink is an acceptable way to comfort herself. After you get her to attach to an item that she can safely carry and sleep with you can start to stop the midnight drinks and finally get a good nights sleep.
I hope this helps!