In order to run a capacitor, your charging system must use a permanent-magnet rotor. The 77 Kz400 D4 did not come with one, and I don't think the other 77 Kz400's did either. So you would have to find a way to convert your charging system to a later year charging system. That means replacing the stator, rotor (aka flywheel), and regulator and rectifier.
If you are removing the starter then you need a way to hold the starter chain inside the alternator housing. Or if you remove the starter clutch sprocket and chain, you will need a deletion arbor. The starter clutch sprocket covers an oil passage on the crankshaft end. The models which don't have a starter have a little piece of hardware to cover that passage. You could maybe just remove the chain and have the sprocket spin around with the crank... I don't know if that will put excess wear on the starter clutch, but I wouldn't chance it. They are getting hard to come by.
The slight alteration to the wiring is done after you convert it to a later year (which requires a bit of re-wiring itself). Some combo reg/rec units will have a brown wire on them. That brown wire should be re-routed directly to the white/red output wire of the regulator/rectifier. If the reg/rec does not have a brown wire, then you don't have to make any changes after your conversion.
Another alteration you will need to make is to have a switch to turn off the lights on the bike until after it is running. Or I prefer a relay that automatically turn the lights off when the bike turns off. Then I use the starter button to trigger the relay to turn the lights on after it's running. The lights act like a short when they are not turned on and will drain away the voltage from the capacitor when trying to start the bike. Once the bike is running, you give it a rev and turn the lights on. The momentum of the engine keeps it turning and the lights will come on and the engine will continue running.
The bike needs to be in good tune and start reliably in one or two kicks with a battery before attempting to go without a battery.
So instead of all that to run a capacitor, you can just run a small 12v battery. You don't really need to make any changes to run a scooter battery or computer UPS battery, other than to make a physical battery box. and new wire connectors. I pull these 12v 9AH batteries out of the recycling bin and if they have over 12v on them, I charge them and use them for various project. Some have lasted for years (after they have already been used for many years and deemed un-serviceable). So I'm getting them free. But you can get brand new ones for less than $20 if you shop around.
Here's one, but I never used that seller. You may want to find a local battery shop.
batteryguy.com/12v-9ah-sealed-lead-acid-...PEAQYAiABEgItUvD_BwE
I also use 12v 7AH batteries that have the same dimensions as the 9AH. The 7AH are older and cheaper but should work fine. Either should work fine as long as you don't leave the ignition and lights on with the engine not running.
The Kz400 frame is perfectly fitted for the battery. Notice how it sits perfectly between the frame tab and the support pipe. You have about 3/4" of clearance above the frame rails before you hit the seat pan. And the way I have the battery, the positive terminal would only come into contact with the document tray so it doesn't hit anything metal. When I get a chance I'll post a photo from the side with the seat and tank in place so you can see how the battery is mostly hidden.