There are other charitable resources available to those with no income, homeless etc. for medical purposes. Most hospitals have a charity fund that cover the cost of medical treatment if the recipient can't pay. There are forms to fill out etc., but asking your local hospital about their programs might shed some light on it. And you can't discount free clinics that give away medications. They are usually in sample packs, but it's amazing how many sample packs a doctor or nurse can shove in a brown paper bag.
Medicaid co-payment depends on the cost of the medication. My friend has elderly clients whose co-payments are up to fifteen dollars for one medication. You'd have to figure out the price of the drug and then calculate the percentage of co-payment based on the state in question's requirements, etc. And, in some states, medicaid won't cover things that aren't considered "necessary". Such as dental treatments, for just one example. Only certain dental work is covered by state insurance for adults. Extractions, antibiotics, sure, but forget having someone get a filling or a cap because it's "cosmetic". And there are others who can't get coverage at all unless the disease or illness is life threatening. There are so many different loops and so much jargon with state insurance, it's not even funny. Children under 18 are completely covered for anything except plastic surgery (and they'll even pay for it if it's a necessary case IE car accident, animal attack etc).
A homeless person would more likely go to a free clinic and get free meds, though. State mandated insurance wouldn't be something he or she could get. A valid identification card, birth certificate, Social Security Card, proof of income, proof of residence are only a few things he or she would need in order to get an insurance card. States differ, though, so it might be best to find out exactly what your state (or the state the book is set in) requires. There may even be provisions for the homeless. I don't really know. With our Blue Cross coverage, it's around 900 dollars a month for the family plan we have and it covers 80% of everything. If our bill is two grand, we pay four hundred. With state, the percentage is much smaller, but it shouldn't be hard to figure it out. Hope this helps a little bit.