I mean, I'm not really a programmer but at least some of it seems pretty self explanatory. int EChash is where they create a variable, so called because EC stands for Electric Charge, hash meaning the number signifying the current EC. They also make two other variables, frames and requestAmount. Below, these are defined with the = operator (OnLoadVessel is probably telling the game to grab the EC value when the vessel loads on the launchpad). Etc etc.
You just want to read each section carefully and find where ElectricCharge is being referenced. Figure out what terms the game uses to reference the resource you're interested in. Slot it in and see what breaks, find out why, and so on.