There are thousands of promising drugs for treating diseases that are simply not getting studied or brought to market because they are derived from natural or common substances that can't be patented. The dirty little secret of the pharma business is that even a miracle cure for cancer won't be invested in if it can't be defended as a proprietary product.
So here's an idea for the ultra-rich (if you are reading this). If you really want to help the world, start a foundation that funds "open-source medicine" -- the research, development, trials and distribution of non-patentable (or at least non-patented...) drugs. This includes not only herbal and traditional remedies, but also other remedies derived from common substances that just cannot be patented. And in addition it includes potentially patentable cures, which are found and then deliberately released as open-source so that nobody can patent them.
Open-source development has made a huge difference for software, so why not pharma and medicine? Why should all drug development be commercial?
Your shiny new foundation would bring together the greatest minds to collaboratively cure diseases for the betterment of mankind. Now that would be a great legacy!