Mega2560 & 12v peristaltic pumps

So I recently jumped head first into a project I saw online of a diy autodoser for hydroponic growing and I immediately wanted to replicate it for soil purposes. The hardware is exactly the same, I just need to rewrite the sketch to modify some parameters and menu prompts. That is the issue. I will have all parts required within a few weeks, but that being said, I want to get a jump start on the coding. I know electrical components, it's the c++ I'm foreign to. So my question is this, if I have a complete sketch that presumably functions without failures or flaws, would it be easier to try and decipher what is needed vs not and modify it,

OOORRRRR......

Start from scratch and write the program yourself? I'm sure I can use the reference project I found online, the dromatic hydro doser, but from what I gather, one never knows what they're going to get themselves into.

Fwiw, I'm not looking for a super sophisticated system here, just something I can set TEN 12v peristaltic pumps to add X amount of nutrients to a reservoir holding Y amount of water and be able to set each one individually, to add Z TSPNS/GAL. It will then trigger a pump to activate the nutrient mix, based off a set schedule (not moisture sensors). Unit should monitor the PH via probe, and correct it by activating 1 of 2 peristaltic pumps, a set dose until the reading is within a set acceptable range. The reservoir will have been measured by flow meters, the amount of water coming IN as well as going OUT to the plant pots. I'd also like for it to be able to associate up to 6 solenoids based on the feeding schedule I input (each solenoid goes to a watering main for each of my rows of pots). This allows it to know which sets are to be watered/fed (opened) one at a time, but as a whole room.
Ie
Solenoid a+b+c+d for XX gallons
Solenoid e+f for XX gallons

I can provide a crude diagram of what it is I'm going for if it helps. And as always, any insight would be greatly appreciated.

I could have went out and spent the money for a prebuilt commercial unit, but as I said, I know electronics. Not so much coding so I knew I could build it physically MUCH MUCH CHEAPER, I just need to configure the operating system now.

Point of the whole story, do I try and modify, or do I rewrite (dust off the old C/C++ for dummies)?

In either case you need a decent understanding of C++. Without it you won't be able to program, nor read and understand existing software sufficiently to make changes and fix issues.

Which one is easier depends on the complexity of the code you may write, and the extent of the issues you want to change, and your coding skills, and your debugging skills, and how well the original software is written/commented, and probably a few more factors.

My general rule: unless it's a complete working piece of software that happens to do exactly what I need (never happened), or a well documented library (routinely happens), or a single easy to understand function (occasionally happened), I'm writing my own.