We've discussed this many times before, but it seems to me today that this is worth emphasizing, and maybe having a thread on "Tips on offsetting pleasures against pains."
On Epicurus' last day, when he was experiencing sharp bodily pain from his kidneys, it was "the joy in his heart" that he stated he was offsetting against that pain.
Quote from Epicurus Letter to Idomeneus
 When he was on the point of death he wrote the following letter to Idomeneus: ‘On this truly happy day of my life, as I am at the point of death, I write this to you. The disease in my bladder and stomach are pursuing their course, lacking nothing of their natural severity: but against all this is the joy in my heart at the recollection of my conversations with you. Do you, as I might expect from your devotion from boyhood to me and to philosophy, take good care of the children of Metrodorus.’ Such then was his will.
Under most interpretations of categorizing pleasures, "joy of heart" is considered to be an "active" or "kinetic" pleasure:
Quote from Diogenes Laertius
And Epicurus in the work on Choice speaks as follows: ‘Freedom from trouble in the mind and from pain in the body are static pleasures, but Joy and exultation are considered as active pleasures involving motion. '
Go many places on the internet and in modern books and you'll find that they say that Epicurus held "static" or "katatestematic" pleasure to be the ultimate goal. But if we focus on what Epicurus himself did when the chips were down and he was in great pain and on the edge of death, it was the value of "active pleasures involving motion," even if only the active motion of his mind in summoning up the joy from memory, to which he looked for comfort in the face of the worst pains.
Epicurus didn't say to himself, as far as we know, "My kidney is in terrible shape, but boy my liver has no pain at all!" He didn't say, "My kidney is in terrible shape, but my mind is 'healthy.'" Both of those would be legitimate observations given the sweeping view of "pleasure" as Epicurus seems to have defined it, but it's worth noting which pleasures he picked out for comfort in that letter to Idomeneus.
So if we were to work on developing tips for what to look to in bad times, certainly "it is sweet" to look upon the troubles of others and see that you are not suffering from them," and that's a comfort to be taken in bad times too. But even there, does not that constitute a "motion" of the mind?
At any rate I think we can resolve all these questions in a very satisfactory way, but the next time we read someone saying that kinetic pleasures exist only for the sake of katatestematic ones, with the implication that we would be better off doing away with all "kinetics" whatsoever, I think we can look to the "Epicurus' last day" example for the very great value of "kinetic" pleasures.
Would we indeed find that it is not always, but frequently the kinetic pleasures to which we reach in making sure that we can find a predominance of pleasure over pain? Maybe it's possible to list out types of situations where looking to one type of pleasure is more useful than others, and that might be a handy way of sorting things out for future reference.
Note: There's some good material in this thread, but it's less useful now as some key posts no longer there.