When I decided to divide half of it to donate to those in need, it worked very well to stop the desire and greed to be more controlled.
That is true. When a gambler starts feeling their responsibility, definitely they will gamble consciously so that they could stop their gambling at their wish. Emotions cannot control a gambler who is gambling responsibly. You may not be necessarily having a responsibility for donating but your responsibility could be related to your family or your own health and wealth related too. That will work in a way so that you could gamble profitably or at least you may not lose big.
I have always thought of donating a part of it if I win that huge or my imaginary prize.
That is the wish of every gambler but fortunately or unfortunately gambling never let to fulfill our desires. When you are planning up to win big so that it could donate then you will never end up your gambling with profits. You are just planning up to make big profits out of gambling and donating from that is just a secondary thing. In my experience, that had never worked for me too.