Haha, I actually have rabies and flu and the black plague in my todo list, this will make it quite a bit easier. I plan a system for stopping/healing them as well, but this is nice groundwork. The current system I use is similar, but for made up sicknesses and not quite as refined.
I would like to expand on this and add it to masterwork, probably in with the second next update.
I'd be honored!
I'll give you a short summary of how this works to help you decide how to customize it.
1. The bit in add to creature makes creature capable of performing the relevant SET_EPIDEMIC_BOOL on itself. This has e.g. 5% chance of giving it the EPIDEMIC_BOOL_TRUE syndrome and 100% chance of giving it EPIDEMIC_BOOL_SET syndrome (to prevent repeating this ever).
2. EPIDEMIC_BOOL_TRUE allows a creature to perform EPIDEMIC_SWITCH, which is just what it says - adds random epidemic(s) to the creature. It contains a set of probabilities for a creature to be able to perform SPREAD_EPIDEMIC_1, SPREAD_EPIDEMIC_2, etc. on itself. If prob SPREAD_EPIDEMIC_1 = 50%, any creature of that race now has 2.5% chance of instantly becoming sick with influenza once after entering the map. This happens only once per creature because EPIDEMIC_BOOL_TRUE lasts a shorter time than is required to perform the interaction twice, while EPIDEMIC_BOOL_SET is permanent.*
3. SPREAD_EPIDEMIC_1 is the disease model. A creature that it is performed on can now do SPREAD_EPIDEMIC_1 according to the CDI parameters (this part is to be removed for noncommunicable disease), and will now perform DISEASE_EPIDEMIC_1 on itself at defined intervals for as long as the disease lasts.
4. DISEASE_EPIDEMIC_1 is the disease's symptoms. It's actually an interaction that gives a creature one or several of the disease's syndromes when performed. For example pneumonia has two: [SYN_NAME:is wracked by a violent cough!] (95%) - Coughing blood and fever lasting 1 month, and [SYN_NAME:is losing their lungs to pneumonia!] (10%) - lung necrosis.
Currently my "vanilla" diseases cause a creature to perform DISEASE_X_Y on itself either only once (epidemics) or every month to choose syndromes, and all syndromes last 1 month once chosen, so a diseased dwarf gains and loses symptoms every month, but it could just as well be every day or year.
5. MEDICINE_X is added to IT_CANNOT_HAVE_SYNDROME_CLASS in SPREAD_EPIDEMIC_1 and DISEASE_EPIDEMIC_1 targeting. Currently all my medicines work as both cures for symptoms and for preventing the spread of disease, but for example the following is possible too:
a) Vaccines - add token to SPREAD_EPIDEMIC_1 only. Prevents spread, but does not cure; make permanent by removing the END: in the medicine syndrome
b) Symptomatic drugs - add token to DISEASE_EPIDEMIC_1 only. Prevents symptoms, but not spread.
c) Drugs that relieve particular symptoms of a disease only: split DISEASE_EPIDEMIC's targeting into two creatures (A and B), define both as SELF_ONLY in the CDI, make syndromes target separately and add IT_CANNOT_HAVE_SYNDROME_CLASS to one syndrome's target only.
Hope that made it more approachable. I'm not assuming you can't read the raws just fine; you're much better at this than I am. Just thought I'd save you some time rather than have you read it line by line.
*You may notice this can lead to some clustering of a class of diseases and it does, but it's mostly insignificant in actual play since you still generally get the epidemics and diseases separately so long as their probabilities aren't very high (current: prob: flu=2.5%, pneumonia=1.5%, flu AND pneumonia =0.75%). Why it works this way is I started with diseases with cross-immunity, where a system like this gives no clustering and you can use cumulative probability, plus it's faster to write. I kept it this way because it's faster to write and easier to add to creatures as is for lazy people - to remove clustering, just have every disease have its own EPIDEMIC_SWITCH; then you have to decide individually which gets what. EDIT: I just realized how to fix this if desirable without doing that - make creatures' probability to get epidemics relatively high and individual epidemics' probabilities really low, which would give e.g. bool_epidemic: 50%, flu 5%, pneumonia 3% -> flu 2.5%, pneumonia 1.5%, flu AND pneumonia = 0.0625% ~ 0.0375%=2.5%*1,5%.
Later edit 2: Clustering is now fixed by default in the newest updates.