It is not as easy as you'd think. HP carefully balances cooling needs with the heat capacity of the heatsink and the fan combination, and applies a certain amount of PWM throttle to the fan so it runs at a certain speed at baseline. The amount of PWM throttle is specific, and less PWM restriction will be supplied as you boost fan baseline speed in BIOS, and also as the motherboard's cooling control infrastructure responds to specific environmental stresses (such as rising ambient air temperature). So, even though I can dink with these to my heart's content, I leave them at the HP standards. Here's the key info if you wish to dink:
The Z400s largely use the higher capacity "performance" heatsink and fan with the 92x92x25mm fan. This is because most of the processors of value for the Z400 are 130W max TDP. In contrast, the dual processor Z600s processors of value usually run at 95 watt max TDP. Hence, they usually get the smaller "mainstream" fan. The more expensive processors run fast at lower temps.... the Z400 usual processors are more brute force (higher voltage solution, hence they run hotter for same fast speed). The heat of two processors inside the Z600 is something HP needed to master. To cool the single hot processor in a Z400 probably was easier, and the hot processor got HP more bang for the buck.
The Z400 performance heatsink/fan is HP part 463981-001, and its fan is a Delta AFB0912HH, with standard 4 wire PWM in/out of the motor. The 5th hole in the plug would be empty if it was a mainstream heatsink/fan, and is occupied with a ground jumper from hole 1 to 5 if it is a performance heatsink/fan. That is how the motherboard knows a performance fan is attached. It can't tell by current or rpms what is going on..... So, there is some room for spoofing here, but I do not advisee that. These HP fans often have a HP part number on their label (which is the direction of air flow always). Then, it often will have an added modifier number for HP, and in this case it is -7W32. That has to do with the specifics of the number of wires, their length, and the plug type. See pic below:
This is exactly the fan from the Z400 performance heatsink, and that is the one I'd buy from eBay where I just snagged the pic from. You can't see the plug well, but it is a 5-hole plug with the ground jumper just barely visible here.
Wiring: As with conventional PWM wiring the pins 1-4 are ground, +12VDC, RPM sense to the motherboard from the motor, and finally PWM throttle control from the motherboard to the motor. If you use a nice quiet PWM fan instead of the HP one it will be over-throttled by the built in HP PWM throttle and run too slow when you plug it into the motherboard. I discovered this with nice Noctua PWM fans......
The motherboard knows if you have a 130W processor installed, and will protest if you don't spoof the wiring or give it the correct wiring with a proper fan (which is my advice now that you know what fan to go buy). There also are other 4-wire 5-pin plug used HP fans you can get off eBay that will work too, and so you can experiment around.
You can salvage a 5-pin plug off a bad HP fan. The brown plug ends are generally meant for rear/front case cooling. I also have posted in here on my Mouser.com source of plug ends. You can extract the metal ends from the plug if you are careful while pressing in the locking tab that you can see, and you can gently bend back out that thin fragile locking tab so it will work again if you want to solder on a ground jumper from terminal 1 to 5. If you run these HP fans at 12VDC they run way too fast. It is all a balance act HP figured out. Things have gotten more complicated in the Z620 era and beyond.