Apparatus and methods are described for use with a portion of a subject's body that moves as a result of cyclic activity, including sensing a phase of the cyclic activity. In a first cycle of the activity, in response to sensing that the activity is at a given phase, a therapeutic tool is actuated to apply a treatment to the portion by applying energy to the portion. Following the given phase in the first cycle and prior to an occurrence of the given phase in a subsequent cycle, the tool is inhibited from applying energy to the portion. In a second cycle of the activity, subsequent to the inhibiting of the application of energy to the portion, and in response to sensing that the second cycle is at the given phase, the tool is actuated to apply energy to the portion. Other applications are also described.