I had a think about this last night and I believe that you can act as though you have distributed the profit to any of the beneficiaries in order to work out the tax due e.g. may pretend that you have distributed it to a limited company where the tax rate is 30%. Therefore the remaining 70% you can re-invest.
The company would then get an IOU for the 70% you have re-invested, and would receive the actual cash at a later date. Sound reasonable to everybody?