What things affect the chances of getting coughing up blood?

Many. Coughing up blood is related to many factors- what is causing the cough, the chronicity and frequency of the cough as well as any changes in blood clotting or bleeding. Coughing up blood can be a very serious problem and should be evaluated by a physician.
Infections, cancer. Coughing up blood can be from bronchitis from t.B or other lung infections or can be from lung cancer. It could also be blood coughed up from the esophagus from varices. This is not a normal symptom and you should consult a physician as soon as possible.