How would you code a "contact.HOLDING"?

I’m trying to have my character load up energy at a base, so once it is staying in contact the energy variable should increase. Unfortunately contact.MOVING is not the case here, both objects are aligned on a platform and not moving. That’s why the contact would only be triggered once. How could I do it, please?

      if contact.state == BEGAN or contact.state == MOVING 
         then        
            if (contact.bodyA.info == "player" and contact.bodyB.info == "base") then
                print("add one energy here") -- to debug
            end

            if (contact.bodyB.info == "player" and contact.bodyA.info == "base") then
                print("add one energy here") -- to debug
            end   
        end  -- of contact.state

Why not just check if the player is within X pixels of the base, then it doesn’t matter if it jiggles a little bit

Good idea! Thanks!