Do you mean to add a new partition or a container file on an existing partition?
It the former you really just need to resize the existing HFS partition w/
diskutil resizeVolume which moves data from the end of the disk elsewhere so it may be shrunk:
Usage: diskutil resizeVolume MountPoint|DiskIdentifier|DeviceNode size
[part1Format part1Name part1Size part2Format part2Name part2Size
part3Format part3Name part3Size ...]
Non-destructively resize a disk. You may increase or decrease its size.
When decreasing size, you may optionally specify new partitions to create
to fill the newly-freed space. Specify these new partitions as in the
diskutil partitionDisk command. A size of zero will cause a grow fit-to-fill.
Ownership of the affected disk is required.
Valid sizes are floating-point numbers with a suffix of B(ytes), S(512-byte-
blocks), K(ilobytes), M(egabytes), G(igabytes), T(erabytes), P(etabytes),
or (%)percentage of the total size of the whole disk.
A size of "limits" will print the valid range for the current conditions of
the file system and room to grow up to an immovable object (next partition).
A size of "R" for the target partition will resize it to the maximum
possible; "R" cannot be used for the size of new partition triples, if any.
resizeVolume is only supported on a Journaled HFS+ file system.
You could theoretically use this to crunch the partition down to occupied space and then re-expand it thus creating a contiguous free region in the existing partition for a container file to utilize if you meant the latter.