I think the word "cowardice" places a value judgement. Let us reserve the value judgements for now and see suicide for what it is.
People seem to commit suicide for various reasons, starting with the main ones
(1) When the pain and suffering in life is too much and there is no apparent mechanisms to deal with it
(2) Ritual suicide, as an act of religion
(3) As a sacrifice to gain something either for yourself or for another e.g. Suicide missions for your country
(4) When one has completed the mission they came for in life and voluntarily leave or they feel that the current body is no longer fit for the purpose of the mission
(1) This accounts for most suicides, and in most of these cases the person did not explore enough the mechanisms to deal with their pain and suffering. e.g. People who commit suicide because their partner cheated on them; well, there are plenty of fishes in the sea; people who commit suicide because they lost their job; there are more opportunities. People who commit suicide because they have become bankrupt; well there are plenty of homeless people who manage, so why not them?
However, there are genuine cases where the pain and suffering is too much to bear, for example if you are dying of a painful disease, and there is no cure for it, then why bother going through the pain, just end it and avoid the rest of the pain. If suppose you you fall in a pit of snakes and there is a gun nearby, do you wait to be slowly get bitten by every snake and eaten alive, or pick up the gun and shoot yourself? I would choose the latter.
(2) Ritual suicide is often due to wrong belief. If a religion demand ritual suicide, and one must seriously question such beliefs e.g. In the Halle comet cult, the disciples did not question the reasons why they should commit suicide, rather they just believed purely on faith what the cult leader was saying. This is a stupid reason to commit suicide.
However, there are cases like in Jainism, when towards the end of their life they ritually starve to death to complete one of the rites of facing starvation and death. The rationale here is to face starvation, hunger and death so that you don't have to face it in another life. There are cases in some Tantric cults, where the disciples gives themselves up as a sacrifice to a God because of their strong belief that it will produce good for them after. In voluntary acts of Sati the wife would self-immolate to follow her husband into heaven.
(3) This sort of suicide is sometimes necessary to save a larger number of people e.g. You are stuck in a boat with a group of people and the boat is too heavy, somebody has to get off the boat or it will sink, by committing suicide you save many people. Do you get good karma or bad karma for this? I would like to think good karma due to your selfless act.
(4) This form of suicide is rare and it is normally done by yogis. When a yogi feels they have reached the end of the tether of their life, they voluntarily leave their body either through yogic means or by self-immolation drowning etc. However, it is also true for one who feels that the current body they have is not fit for a purpose. In the Mahabharata, Amba for example committed suicide because she could not get revenge on Bhishma in her current body, so she came back as Shikindi. If suppose your mission is to climb a mountain, and then you break your legs, then your current body no longer serves your interest, hence you need a new body.
Hence, from the Hindu point of view suicide can be a right or wrong thing depending on your circumstances and motives.