Apparatus, comprises: an implantable element (20) configured to be implanted within a body of a subject; and a phase-change material (22). The phase-change material (22) is configured: to be implanted within the subject's body in a vicinity of the element (20), and to absorb heat from the element (20) by absorbing latent heat of fusion resulting from a phase-change of the phase-change material selected from the group consisting of: wax to liquid, solid to liquid, solid to gel, and gel to liquid, in response to the element being heated.