Limit battery charging to a certain level? I have some iPhones which are connected via USB to a computer 24/7.

This set-up drastically reduces the battery life-time: The integrated battery is swelling every 1-2 years in a way that the iPhone nearly disassembles itself (the device has a gap in the middle of more than 5mm so that you can right look into the device and the display is a bit "curvy").

As the devices nearly constantly are powered via USB the battery I don't care if the battery is charged 50% or 100%. Is there a possibility to limit the maximum charge or is it possible to disable charging on a jailbroken device? 

Note other answers like "don't charge the device the whole night" are useless to me as the phones have to be connected via USB 24/7 because the devices are accessed via SSH over USB. And answers that indicate that there is no risk in charging a device 24/7 are obviously wrong as I have multiple devices that continuously get a swelling battery after a certain time if they are connected via USB 24/7.
There's really no option in the iPhone to limit it to charging the battery to 50%, or temporarily disable charging.

However, I suggest that you turn the problem around and look at it differently. Namely just stop supplying power to the phone, when you do not want it to charge. You can leave the cable plugged in and have data transfers continually, but just don't supply the +5V for charging.

This can be done by plugging the iPhone into a hub that supports per-port power control and then plugging the hub into a computer, where you can use uhubctl to turn on/off ports as you like:

https://github.com/mvp/uhubctl