6 volt drop to 1.2 volts
To charge a NiMH cell from 6 volts you need a circuit that limits both the voltage and the current. You might be able to arrange resistors and diodes to trickle-charge an already charged NiMH cell but it's hard to guarantee that this will keep the cell charged but not overcharge it, especially if the load on the cell varies at all over time.

However if you already have a 6 volt battery that's being charged from the solar panel, it's not clear why you need the NiMH cell at all. You just need to regulate the 6 volts down to 1.2 volts or so for the supply to the shocker circuit.

Have you measured how much current the shocker circuit draws? If it's no more than 100 mA or so, a linear regulator will work just fine. I'm sure there are fixed-voltage 1.2 V parts, but an LM317 is readily available and will deliver 1.25 V with the adjust terminal tied to ground:







simulate this circuit &ndash; Schematic created using CircuitLab

The capacitors are there for stability, but you might be able to get away without them; the resistor is there to guarantee the 10 mA current draw that the LM317 needs for proper regulation, but if the shocker circuit always draws at least that much then you could leave that out. At 100 - 200 mA current draw the LM317 won't need a heatsink but at higher currents it would - bear in mind the heatsink tab is electrically connected to the output pin.

If you need more current the LM317 will supply up to 1.5 A, but you don't want to throw all that solar power away as heat. In that case a DC-DC converter ('buck converter') is the way to go. These are widely available on eBay with either fixed or adjustable voltage output - just check that the input voltage, output voltage (range) and maximum current match what you need.