- base cost: 1 gp/hp
- huge: x10
- rare: x10
Now, compare the mule, which costs 30 gp and has 2+1 hit dice. That's an average of 8 hp. A mule is definitely not huge, but it's substantially large and used as a pack animal, so we could set a multiplier of x4 for that and we've covered the cost. We can still use the other multipliers (x1.5 per talent/feature, x3 for war-trained) and that pretty much covers all imaginable animals. An ordinary dog, for example, would cost about 4 or 5 gp, with hunting or guard dogs costing at least 6 gp and wardogs costing 12 to 15 gp, perhaps more for larger dogs.
But how trained is trained? And how obedient is the animal?
My thinking is that animals bought during character creation are completely trained for whatever tasks the player bought them for; the character has had time to form a bond with the animal. Animals bought after character creation, however, may be trained in general, but need to be trained to respond to that character; the character needs to earn the animal's loyalty. Just set an appropriate time -- a month, maybe? -- and treat the animal as fully trained thereafter. If the player wants to rush this, use some kind of a die roll and increase the difficulty for every halving of the base time; I'd use the "roll a d6, 5+ means change" rule, +1 difficulty per halving, reducing the difficulty if the character has an animal trainer background, is a druid, or has Very High Int, Wisdom, or Charisma.
Obedience is another matter. There's two reasons for disobedience: morale failure, which can be handled as for hirelings, and miscommunication. A GM who is very particular about details might requires players to specify in advance what commands or signals the animal is trained to respond to, but I'd prefer to wing it. If a player gives a command in a situation where the animal's instincts are not in question, simple, unambiguous one-word commands and gestures can just be assumed to be part of the animal's training. It's multi-word commands that could result in miscommunication; telling your dog "Hunt!" works, but "Go get food!" would merit one of those 5+ target rolls, with a failure meaning the dog thinks you meant either "go away" or "get food out of the backpack, boy!"
The idea, here, is to keep the rules reasonably simple: same d6 roll as a whole bunch of other things, any reasonable advantage the player names can improve the odds by 1. At the same time, leaving the interpretation of the animal's training for later means that the animal's personality and the PC's relationship develop during play, taking unusual twists. You can wind up with gluttonous guard dogs or parrots who take a dislike to your traveling companions.