With third-person masculine plural:
ضَرَبُوا حَامِدًا becomes ضَرَبُوهُ. The final written alif of ضَرَبُوا is not written before the attached object.
With second-person masculine plural:
ضَرَبْتُمْ حَامِدًا becomes ضَرَبْتُمُوهُ. The ending is linked as تُمُو before هُ.
Say each pair aloud and notice that the grammatical roles remain unchanged.